cancel
Showing results for 
Search instead for 
Did you mean: 

lsm330dl output read problem

mengsophia
Associate II
Posted on June 19, 2012 at 16:50

hi, everyone. i don't understand why the output data XH,XL. is unchange all the time , when i  read the status_reg, i find that there is no new data coming ..and sometimes the same code gave me different output ,like the data is keep changing but totally wrong, even my board is stastic on the table, but the output gives me thousands of degrees bias. i really confusing., any one can help me ?

here is a part of my output

part1:

GYRO_XH  [1]

GYRO_XL: [5]

GYRO_XH  [fffffff5]

GYRO_XL: [c7]

GYRO_XH  [ffffff80]

GYRO_XL: [0]

GYRO_XH  [ffffffff]

GYRO_XL: [f3]

GYRO_XH  [fffffffd]

GYRO_XL: [ef]

GYRO_XH  [ffffffe8]

GYRO_XL: [74]

GYRO_XH  [ffffffff]

GYRO_XL: [ba]

part2:

GYRO_XH: [ffffffff]

GYRO_XL: [e6]

GYRO_X: [ffffffe6]

GYRO_X2: [-26] //2's complement always -26

GYRO_XH: [ffffffff]

GYRO_XL: [e6]

GYRO_X: [ffffffe6]

GYRO_X2: [-26]

very urgent ,many thanks for any help,

#gyro-lsm330dl
24 REPLIES 24
frankmeyer9
Associate II
Posted on June 22, 2012 at 13:59

The output should become bigger if you turn faster.

i find that when i slowly turn the board, the degree sometimes don't change, or change very few. no matter how much i turn.

 

There are some enable registers and bits to set.

Did you check this, maybe the gyro is still disabled ?

For 250dps, you should get about 20.000, if you turn it over in 1 second.

...it only shows me aroud 4 degrees, the sign also don't follow...

That looks more like noise, not senseful data.

frankmeyer9
Associate II
Posted on June 22, 2012 at 15:46

Looking briefly at the settings for the gyro, I didn't detect any obvious problem.

I hope you have noticed that this device has separate addresses for the accelerometer part and for the gyro part. The register addresses of both sub-devices are partially identical.

mengsophia
Associate II
Posted on June 23, 2012 at 04:35

ok , now the gyro can give me correct data alr, and the calculated degree is also correct. but the problem is if i let the board stastic on the table, the degree is keep increasing very fast, why?

frankmeyer9
Associate II
Posted on June 23, 2012 at 19:38

...and the calculated degree is also correct.  ...

 

...the degree is keep increasing very fast, why?

 

Please keep in mind that a gyro does NOT give you information about the current position or angle, but about the rate of change of angle.

Gyros in this price range are not useful for deriving static information, their zero point noise and drift are to large for that. I don't know your code, but that would be a kind of unhopeful endeavor.

I suggest to use the accelerometer data instead for this purpose. As you learn early in physics - if an object stands still, or moves with constant velocity, only gravity is acting on it. That means, you should measure the equivalent of 1g as vector sum on all axes, depending on the alignment of the device to gravity. If the object moves, the acceleration forces add to gravity, but this is algorithmically manageable, and no really a performance challenge for a Cortex M3.

If your sensor data are correct, you are a great step further. The rest is applied physics. If you would like to do some research, look like robots or model airplanes and heliocopters navigate, using acc/gyro data.

mengsophia
Associate II
Posted on June 24, 2012 at 04:58

hi, i find that the data increasing is caused by zero deviation, i alr adjusted it. now the output degree seems correct. but different gyro got different zero deviation, so i must set different value for them.

thanks for the help again.