Experimental Gyro Compass (LeJOS)

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
kvols
Posts: 29
Joined: 14 Oct 2010, 22:09

Re: Experimental Gyro Compass (LeJOS)

Post by kvols »

6.gif
6.gif (11.91 KiB) Viewed 3260 times
8.gif
8.gif (11.91 KiB) Viewed 3260 times
And finally and animation:
gyro-batt-animated.gif
gyro-batt-animated.gif (88.91 KiB) Viewed 3260 times
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Experimental Gyro Compass (LeJOS)

Post by HaWe »

hi,
very nice! :)
from this analog perspective I dare to assume:
Wait 1-2 minutes from the start for the offset to settle,
then calculate 1 gyro unit in dependency from the gliding voltage average (of 3) ,
and squeeze the resulting sensor values through a median filter (of 3).

I bet that will make it much better!
kvols
Posts: 29
Joined: 14 Oct 2010, 22:09

Re: Experimental Gyro Compass (LeJOS)

Post by kvols »

I think I'll take a rest from the gyro investigation for now, so just a few points.

I have found a quite successful way of auto-calibrating the gyro zero offset, using a floating average with the last 10 readings. If the average over the last ten readings is less than one degree, I assume that the sensor is not moving, and I'll let the offset slowly converge towards the current zero point. With this method, the compass stays stable for about a minute or so. (I am of course also using the battery voltage to get an approximation of the zero point).

Another problem has emerged: As Aswin pointed out, we probably cannot assume that the gyro readings are neither linear nor independent of external factors. Just as with the offset, the rotation reading appears to vary with the battery voltage. It looks like the readings are lower at high voltage, and high at low voltage: When I slowly rotate the sensor 90º with fresh batteries, the integration shows about 85º, whereas used batteries would show 95º. This reading varies a lot, and depends quite a bit on the rotation speed, but it is not caused by the zero offset calculation.

As I mentioned before, I'll take a break from the gyro sensor and concentrate on other issues with my robot. I anyone here would like the source texts to play with, I'll post the latest version here, just ask.

Thank you for all the valuable comments and feed-back!

Kindly,
Povl
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests