2012-07-02 09:04 PM
i'm using the accelerometer in lsm330dl. but when i put the chip statically on the table, the xyz output i got from it is very strange,
for x, it's always between 0.2-0.45 for y, it's always around 1 for z, it's always around 16 why? i didn't enable any interrupt, is there something wrong with my register setting? #lsm330dl #accelerometer2012-07-02 10:39 PM
here are some part of my code,
________________ Attachments : 7.3.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0yi&d=%2Fa%2F0X0000000biH%2F7gx3nQuTYg0yGyV.YHx9PtjQRpK4PnfYqrkewRjipV8&asPdf=false2012-07-02 11:19 PM
...,the xyz output i got from it is very strange,
for x, it's always between 0.2-0.45 for y, it's always around 1 for z, it's always around 16 I guess you mean the calculated xyz values, using float. Could you post additionally some ''raw'' acceleromete values ? Your code contains :
ACCEL_Xf = ACCEL_X * 0.002 - ACCEL_Xbias; //divide the ACCEL values by 70 to get degrees per second
You copied that probably from the gyro code. Accelerometer output is
not in deg. per second.
2012-07-03 08:25 PM
sorry, i change the code, but forget to clear the comment.
i changed some register setting values, and uncomment the register 6, and the output seems meaningful. but the z axis always show me 16, and when i flip it over, it shows me -16, i didn't find any clues in the datasheet that i should divided by 16. ACCEL_Zf = ACCEL_Z * 0.002/16.0 ( FS bit set to 01 , 2mg/digit) when i 've done this, the output value looks corret, ie, when i turn it 60degrees, it shows me 0.5g, and all the axies are correct. so strange.2012-07-03 11:29 PM
Admittedly I did not analyze your code in detail - I have no lsm330 to try anything.
But the results are generally meaningful. A significant z-axis output that turns negative when flipping over seems ok. When you tilt the board by 90 deg. in any direction, the corresponding axis should show an equivalent output. I have read comments in other forums that describe the lsm330 as having a somehow noisy output, so the fluctuations of the other axes might be normal. As mentioned, I don't have any, so I can neither confirm nor refute. The scaling is another problem, which should not be too difficult to solve if the readout code is working.2012-07-04 06:22 AM
The only thing I found was this source line, or better, definition:
#define ACCEL_VALUE_CTRL_REG4 0x98 //DISCONTINUES UPDATE#F0, LITTLE ENDIAN. 250 DPS, 4-WIRE
The value is reasonable (BDU, +-4g full-scale, 4-wire interface), but the comment is misleading and wrong.
I assume the comment belongs to the CTRL_REG4_G value for the gyro part.
VALUE_CTRL_REG1 0x97 //ODR 1.344KHZ,
This is quite a high update rate. It makes sense for detection of rather fast movements.
2012-07-07 06:39 AM
thanks for suggestions.