EmbDev.net

Forum: µC & Digital Electronics L3G4200D Gyro rotation angle


von Fin W. (finwood)


Attached files:

Rate this post
useful
not useful
Good afternoon,

currently I am facing several difficulties calculating the rotation 
angle from a L3G4200D gyroscope.
But let's start from the beginning.

I retrieved the sensor on a 10dof-module from ebay (links below). I2C 
communication works, retrieving data from the sensor works, writing 
values into the control registers works as well.
This is my current setting:
1
twiSetVal(L3G_CTRL_REG4, 0b10000000); // enable Block Data Update
2
twiSetVal(L3G_CTRL_REG1, 0b00001111); // 100Hz, cut-off 12.5, switch on, enable all axes
3
twiSetVal(L3G_CTRL_REG2, 0b00000000); // High-pass cutoff 8Hz, normal mode
4
twiSetVal(L3G_CTRL_REG5, 0b00000001); // enable High-pass filter for DataReg

Now strangely, although the device is described as an angular rate 
sensor in the datasheet, I seem to get angular acceleration data from 
it, as you can guess from the attached 'Winkelmessdaten.pdf':
Page 1 shows the raw sensor data, pages 2 and 3 display the cumulative 
sums representing angular velocity and rotation angle, respectively.

Therefore, my main question is: Why?
Why does the sensor output angular acceleration data instead of, as 
specified, measure the angular rate? Is it some misconfiguration on my 
behalf, or was the china module a little too cheap?

Another problem is the zero-rate offset. As you can clearly see, I am 
facing a serious drift. When I'm averaging the first 2.5 seconds (250 
samples), as suggested in the application notes to measure the offset, 
it makes things even worse ('rotang-corr.pdf', channel 'a_c2'). 
Averaging the whole series surely works ('a_c1'), but definitely not in 
real-time applications. Any ideas?

I'd appreciate your help, for I seem to be kind of stuck here.

Kind Regards,
Fin

-------- Links --------
10dof module on ebay: http://www.ebay.de/itm/351195062122
L3G4200D resources: 
http://www.st.com/web/catalog/sense_power/FM89/SC1288/PF250373

von adenin (Guest)


Rate this post
useful
not useful
disable the high pass filter. ^^

von Fin W. (finwood)


Rate this post
useful
not useful
Well...

I guess, it actually was misconfiguration on my behalf.

Thanks, it's working! :-)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.