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:
twiSetVal(L3G_CTRL_REG4, 0b10000000); // enable Block Data Update
twiSetVal(L3G_CTRL_REG1, 0b00001111); // 100Hz, cut-off 12.5, switch on, enable all axes
twiSetVal(L3G_CTRL_REG2, 0b00000000); // High-pass cutoff 8Hz, normal mode
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.
-------- Links --------
10dof module on ebay: Ebay-Artikel Nr. 351195062122