2019-05-15 06:11 AM
Hello,
I use the gyroscope of an LSM6DS3 to command the rotation of a robot.
I read the different axis with a 50ms period and I use the gyro internal timestamp to get a precise timing of each sample and I integrate the angular speed using the trapezoidal rule (https://en.wikipedia.org/wiki/Trapezoidal_rule) to get my angle in degrees.
The problem here is when I place the gyroscope on a test bench and drive two rotations of the same value in two directions, I experice a shift of about 10° per sequence.
What can be the cause of the shift here? Am I missing something ?
sincerely
ps : I of course calculate an offset to make sure the data i read from the gyro ar centered in zero
2019-05-17 08:07 AM
Hi Gabriel, for my better understanding, is the 10° shift you experience repeatable? Which is the speed in dps of your rotating system and how much time does the whole test take? Regards
2019-05-20 01:32 AM
Hi Eleon, Thank you for your answer!
To sum up the test: I have an horizontal weel with my board screwed on it with an angle of about 20°. I command a clockwise rotation of 180° then a counterclockise one of the same value to come back to my original position.
Each sequence last less than 30seconds and the complete test duration is not well define but is more than an hour.
The result is that my second rotation is smaller by 5-10° to the first one. That result is repeatable.
I set the gyro to 125dps and I measure a speed of about 10000 in both direction. I have a static deviation of about -800 to -1000 depending of the board that I compensate with an offset. I recalibrate if I measure a temperature drift of 2°C.
Here is my complete configuration:
ORIENT_CFG_G 0x00 //x,y,z positive sign, x pitch, Y roll, Z yaw
CTRL3_C 0x44 //Block Data Update; incremente address (0x01 SW reset)
CTRL5_C 0x00 //disable self test
CTRL6_C 0x00 //default
TAP_CFG 0x80 //enable timestamp
WAKE_UP_DUR 0x10 //Timestamp resolution = 25us
CTRL2_G 0x62 //416 Hz ODR, 125 dps
CTRL7_G 0x00 //High pass filter off
CTRL10_C 0x38 //enable gyro X,Y,Z axis
Regards,
2019-05-20 01:48 AM
Just to complete,
What bother me the most is not the the imprecision I have on the angle but that it is single sided and I can't explain why.
2019-05-21 07:55 AM
Hi Gabriel, but if you experience a deviation of 10° from measure 1 to measure 2, and you repeat the rotations, you should get an N*10° deviation after N iteration of your test (you measure the angular speed and you integrate to obtain the angle), right? Moreover, considering the single rotation, if you set ODR 416Hz, you could have an error in time of 1/416s and you should take it into account when you integrate... Btw do you have a reference gyro to check the right horizontal wheel rotation? Regards
2019-05-22 12:23 AM
Hi Eleon,
Indeed after N sequence I have a cumulated error of N*10° sorry if I wasn't clear about that.
I totally missed the ODR related error I will try to take into account in the future. Do I risk to increase the noise if I increase the ODR?
I already have a basic filter implemented, where i will considere the speeds between -200 and 200 as noise and ignore them for integration. Could it also be an cause of error? if yes, what a more elegant why to filter the noise would be?
As for the test: The weel is graduated with a 10° precision so I can visualize the deviation.
I also have a second board with the same gyro that i use as reference. It has a better MCU so it uses the FIFO to guaranty the timing (I can't dothat on my board my mcu wouldn't support it), the results are much better but it will still deviate of about 40-60° after a couple of hours.
Regards
2019-05-22 08:28 AM
hi Gabriel,
>> Do I risk to increase the noise if I increase the ODR?
No, there isn't similar risk.
>> if yes, what a more elegant why to filter the noise would be?
Did you implemented an embedded filter or an external one? In the latter case, please consider that you can implement a filter acting on CTRL7_G (16h) bits (p. 59 of the ds)
Btw, I also checked with our experts and I'm asking you a couple of other questions: did you compensated any kind of offset? How "smooth" is the mechanical limit switch of you rotating wheel? Did you try to screw your system directly on the rotating wheel (0°)? In this case you get values from a single gyro axis (yaw), and if you still get 10° error, it could be related to a mechanical quadrature error and has to be compensated
Regards
2019-05-23 01:23 AM
Hi Eleon,
>> did you compensated any kind of offset?
Yes, we have a calibration of that kind. It's as follow:
>>How "smooth" is the mechanical limit switch of you rotating wheel?
The weel is powered by a simple DC motor. At 80% of the target angle I divid the speed by two for better precision.
>> Did you try to screw your system directly on the rotating wheel (0°)?
Yes. I have the same behavior in that case.
But the problem I have is that when the weel the stop, the angle I compute from the gyro is egual to my target value but different from the graduation on the weel(like good in a countercockwise but different for clockwise rotation).
Do you have an explenation for the fact my error is always in the same direction? I would have expected that the error would be more or less balanced in the two direction.
regards,