LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Double integrating accel data from LSM303DLHC to determine position

Hi all.

As the subject implies I am trying to determine position by double integrating the accelometer data from an LSM303DLHC. There are many topics discussed about doing this on the internet but I have yet to find any LabVIEW code set up to do this with Arduino/LSM303DLHC interface.  Has anyone tried this and be willing to share code? 

Thanks in advance

0 Kudos
Message 1 of 3
(3,539 Views)

It's all the same math.  LIFA just allows you to get the data via an Arduino.  The only thing that I would be concerned with is the timestep that you will get when using LIFA because of the relatively slow serial communication and that fact that the timestep could vary based on the load from the OS (the program will slow down if your OS has to fulfill it's other priorities first.

I'm not entirely sure how much accuracy you will be able to get with LIFA getting the accelerometer data because if the timestep is too large, the error of the numerical approximation of the integral can escalate.

One alternative would be to do all the accelerometer stuff (reading values and integrating) on the Arduino and then making a custom LIFA function for grabbing the current value or reseting the value, etc.  Though, because Arduino is only single threaded I'm not really sure if the serial communication on the Arduino side would significantly affect the timestep.  You won't have to worry about the overhead of the OS though.

0 Kudos
Message 2 of 3
(2,677 Views)

Integration in LV (http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/integral_xt/)

This generally doesn't work very well to get position data from an accelerometer alone.  For better data people typically use IMUs, some of which will do the itegration in hardware for you.  An integral on an Arduino is going to be tough (but not impossible)

-Sam K

0 Kudos
Message 3 of 3
(2,677 Views)