ActionNerd / node-L3GD20

Driver for L3GD20 gyro
1 stars 0 forks source link

Data output incorrect scale #4

Open ActionNerd opened 9 years ago

ActionNerd commented 9 years ago

Output data does not appear to be correct. When I run the program, I get these numbers (while rotating back and forth around the z axis) at 250 dps:

{ x: -0.01, y: -0.008, z: 0.162 }
{ x: 0.005, y: 0.023, z: -0.374 }
{ x: -0.006, y: 0.045, z: -0.684 }
{ x: -0.013, y: 0.025, z: -0.424 }
{ x: -0.007, y: 0.018, z: -0.193 }
{ x: -0.015, y: -0.046, z: 0.667 }
{ x: -0.023, y: -0.053, z: 0.799 }
{ x: -0.012, y: -0.025, z: 0.365 }

These numbers should be much higher if they are dps. There must be some scale I need to use. What is the scale? Or am I reading the numbers wrong? Or how do I calibrate?

From Pololu thread:

L3GD20 noise Postby dan77062 » Thu Nov 29, 2012 12:21 pm

I am looking at the L3GD20 data stream from the L3GD20 3-Axis Gyro Carrier with Voltage Regulator board and it seems very noisy. With no movement, here is a sample of the output from the example program "serial" I work with gyros a lot and understand that they drift, but this is not a steady drift, the readings jump all over.

I realize that this is raw data and that when scaled to dps the noise is not so bad, but still seems high. Perhaps I am using the wrong conversion? I am using full scale sensitivity (2000 dps, 70 mdps/digit) so am using a 0.07 conversion from raw data to degrees per sec. Is that correct?

I noted that if I average the readings, they are around a common mean. Is this noise level normal for this sensor?

G X: -17 Y: -56 Z: -150 G X: -57 Y: -64 Z: -212 G X: -43 Y: -72 Z: -188 G X: -27 Y: -76 Z: -151 G X: -19 Y: -74 Z: -221 G X: -25 Y: -29 Z: -137 dan77062

Posts: 7 Joined: Fri Dec 23, 2011 12:24 pm Top Re: L3GD20 noise Postby DavidEGrayson » Fri Nov 30, 2012 3:03 pm

Hello. The noise level in your data looks normal to me.

dan77062 wrote: I am using full scale sensitivity (2000 dps, 70 mdps/digit) so am using a 0.07 conversion from raw data to degrees per sec. Is that correct?

Yes, that is correct.

The "steady drift" you are referring to is probably what you see when you integrate the rotations from the gyro, but you wouldn't see it when you look at the raw readings.

There will generally be some noise and some zero-rate offset for sensors like this. You really have to convert it to some human-understandable unit (degrees per second) to evaluate it. You can look in the sensor's datasheet to get an idea of how much offset and how much noise is typical. You can find the datasheet by going to the pololu.com product page for your device and opening the Resources tab (below the price and short description).

If you still think that you are getting too much noise or too much of an offset from your device, please provide us with the following information:

1) The configuration settings you used on the device. (Different settings can result in different amounts of noise and offset.) 2) 15-50 sets of raw readings from the device, taken while it is stationary. 3) For every axis you are concerned about, the standard deviation and average of the readings from that axis. You can use a spreadsheet program to calculate this. 4) The standard deviation and average, converted to human units. For a gyro, convert to dps (degrees per second). 5) The relevant information from the datasheet that makes you think your readings are atypical.

--David

ActionNerd commented 9 years ago

More from a Stack Exchange forum.

It says the range can be set to 250/500/2000 DPS, which I think is the maximum angular speed the device can measure (i.e 2000 DPS is the fastest setting) DPS stands for Degrees Per Second, so 360 DPS means 60 RPM (revolutions per minute) or 1 revolution per second.

The mdps/digit stands for Milli Degrees Per Second, so (I think) for instance the value of 70 mdps/digit for the 2000 full scale range could be converted to degrees per second by dividing by 1 / 0.07 = 14.286. 1 revolution per second should therefore be 360 * 14.286 = 5413 Make sure you are reading the output registers correctly, the data is a 16-bit value in 2's complement (i.e the MSB is the sign bit, then 15 bits for the value)

Try the above and see how it goes.

ActionNerd commented 9 years ago

From parallax forum.

FS = 250 dps     8.75  mdps/digit
FS = 500 dps     17.50
FS = 2000 dps     70

From user SRLM on the same very helpful thread:

So, if you are running at a scale of +-2000dps, then 1 unit from the gyro indicates 0.070 degrees per second (70 milli degrees per second). A reading of 425 from the sensor would indicate 0.070 * 425 = 29.75 degrees per second.