LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA LSM303DLM Support

Please post questions and concerns with the LIFA LSM303DLM library here.

0 Kudos
Message 1 of 11
(6,677 Views)

Well. I've seen you crossed input of Joint Numbers for accelerometer, not for magnetometer. Why did you make it? The conversion in unit of "g" can be done multiplying for the FullScale and dividing the result for 2^15?

0 Kudos
Message 2 of 11
(4,257 Views)

Well. I've seen you crossed input of Joint Numbers for accelerometer, not for magnetometer. Why did you make it?

Because that is how the data is sent from the sensor.  See pages 21 and 22 of the datasheet.  Notice that the low byte for the accelerometer comes first while for the magnetometer it comes second.

The conversion in unit of "g" can be done multiplying for the FullScale and dividing the result for 2^15?

I believe you simply multipy the output by the linear acceleration sensitivity found in Table 3.  You can check for ballpark correctness or calibrate with gravity.  If I needed g's back when I used this sensor, I believe I probably calibrated it based on gravity.

0 Kudos
Message 3 of 11
(4,257 Views)

Thank you. I'm trying to implement roll, pitch and heading for this sensor, moving a 3D scene. Is there a method to initialize or calibrate it? my cube rotate but there is a "noise" in its rotation and it is inclined without movement of the LSM303. I tried with an empty value at Property Node ---> History for the waveform chart, but I didn't solve the problem. Is it an environmental disturbance?

0 Kudos
Message 4 of 11
(4,257 Views)

Noise and drift are common sources of error that you need to account for when using most any sensor.  For calibration and filtering I suggest searching online since this is a very common necessity (for which I am not an expert).

0 Kudos
Message 5 of 11
(4,257 Views)

Nathan I filtered the output data with a digital Butterworth filter, with a low cut-frequency of 0.1 Hz: the result is excellent. Thank you for all the answers, they were very helpful.

Best regards.

0 Kudos
Message 6 of 11
(4,257 Views)

I've uploaded the LIFA sketch on my Arduino MEGA 2560 board, but while trying to use the Accelerometer Read Axis.vi and Graph.vi I keep receiving the following error (code 5003):

A timeout occured while trying to read from the Arduino.

What am I doing wrong?

I've selected the right resource port and selected "Mega 2560" as Board Type.

My accelerometer is the LSM303DLH.

0 Kudos
Message 7 of 11
(4,257 Views)

Where does the error occur?  Are you able to run some other examples?

Also, a common mistake when using an Arduino Mega 2560 is that you need to set the baudrate on Init.vi to 9600.  Other possible issues/fixes can be found in the error's documentation.

0 Kudos
Message 8 of 11
(4,257 Views)

I've found that my problem was the USB serial. Once I've changed the name of the serial, everything worked. I think that my error was to abort the vi and because of this the USB was considered still busy while it wasn't at all.

I have one last question: if I want take samples at higher frequency for a chosen period of time and send the whole data to LabView, how should I procede? If that's not possible, is there a way to improve the sample rate?

0 Kudos
Message 9 of 11
(4,257 Views)

AndreasSchnaas wrote:

I have one last question: if I want take samples at higher frequency for a chosen period of time and send the whole data to LabView, how should I procede? If that's not possible, is there a way to improve the sample rate?

That would require major modifications to the LIFA firmware.  You would need to move all I2C communication to the Arduino (meaning my Library would be useless) and write special functions to do all of what you are asking.  It would probably be similar to the finit acquisition that exists for analog input in LIFA.  However, the Arduino will not be able to store all that much data so the length of time will be relatively short.

Sorry I can't help you with that.

0 Kudos
Message 10 of 11
(4,257 Views)