tyotyot / adxl345driver

Automatically exported from code.google.com/p/adxl345driver
0 stars 0 forks source link

accel_cal.py needs documentation #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there!

Thanks for this awesome driver! I'm using it for my orientation sensing 
library.. see 
http://www.varesano.net/blog/fabio/initial-implementation-9-domdof-marg-imu-orie
ntation-filter-adxl345-itg3200-and-hmc5843-a which will be part of my FreeIMU 
project.. see 
http://www.varesano.net/blog/fabio/freeimu-designing-free-speech-9-domdof-marg-i
mu and https://launchpad.net/freeimu/

I'd like to ask a few questions about accel_cal.py. What does this script 
actually does? I see some kind of optimization but I'm not sure how to use it.. 
I guess it is something similar to what is explained on this document 
http://www.st.com/stonline/products/literature/an/17353.pdf

So, I'm wondering.. how do I use this script? What's the expected file format 
of the .dat file? How does the accelerometer has to be moved to collect the 
.dat file data? What are it's outputs? How do I use them in the driver code?

My guesses from fastly looking at the code: 
.dat file format is "Xval Yval Zval\r\n" repeated for many lines
Outputs is something useful for populating the gains array in ADXL345::ADXL345()

Thanks for any kind of help!

Take care,

Fabio Varesano

Original issue reported on code.google.com by fabio.va...@gmail.com on 19 Jan 2011 at 10:18

GoogleCodeExporter commented 8 years ago
This are perfectly valid questions.  This code was not indented to be 
delivered.  A more complete cal routine should be written.  

This code as is only calibrates the X and Y axes.  To collect the data slowly 
rotate the accel so that down is always in the X-Y plane.  You are using the 
gravity field as a calibration source.  The more patients you have the better 
the cal.

x-y-z data is collected and stored into a text file.

The cx, cy and r solution describe the circle of best fit.  Expect a more 
complete cal file soon.

Original comment by wyojus...@gmail.com on 18 Feb 2011 at 2:49