Determine ones heading in an autonomous vehicle is very important.  Without it, it is very hard to navigate a race course like the one for AVC. I have been very involved with FIRST LEGO League (FLL). The experiments that I did with my team conclusively demonstrate that controlling heading accurately is paramount. Make a turn and not have it be exact then drive some further distance and you pretty much have no idea where you are. In the case of FLL, you need to zero out your error by registering against objects.

In the case of AVC, that is not really an option. You need to get around the course as fast as you can. Stopping to bump up against the hay bales is a non starter. So for the last few months I have been researching ways to determine azimuth. I present some of my findings.

1) GPS. GPS can report a heading if you are moving. The accuracy of the heading is based on many factors including the “constellation” (what satellites are visible in what orientation in the sky), Your view of the sky, the accuracy of your receiver, and your speed. Not much you can do about any of these factors other than to buy the best GPS you can and to keep it away for RF noise sources. Take the worst case of a robot moving slowly with a poor constellation. Since each of your positions will have an error circle around them of possibly several meters, if your robot does not travel that far in the update rate of the GPS (often 1Hz) then the heading it might compute could be 180 degrees wrong! GPS also only tells you what your heading WAS and not what it currently is.

2) Magnetometers. Using a digital magnetic compass seems like a great solution until you start to experiment with them. First, the raw values from the magnetometers must be used to compute the heading. The math to do this is not overly complicated and samples can be found on the web. The real problem with them is in the environment they work in. If they are placed near ferrous metals, objects that are magnetized, or near strong currents, they will report incorrect headings. So what in a robot might be made of ferrous metals, include very strong magnets, AND consume a large amount of current? How about the drive motor(s)? So this problem can be mitigated by moving the sensor as far away from the motor as possible and putting a MuMetal shield around the motor.

3) INUs. Inertial Navigation Units are a combination of gyro and accelerometers used to compute the RELATIVE change in pitch yaw and roll from the time the unit is powered on. If you start it up wings level facing north, then the output of the unit will give you proper values. The problem with these devices is that they accumulate errors quickly. Unless you can afford 5 or 6 figure sensors, the reported heading will drift over time by at least one degree per minute if the object is held motionless. If the device is in motion, the drift rate will be about 10 times larger. So for a 2 minute AVC run, that would be a 20 degree error.

4) Solar. One concept I have been working with is a sun based azimuth device. Probably should keep this to myself, but its too interesting not to share. At work I am using a heading device that works by taking a picture of the sky. It finds the “big bright round thing” in the picture (sun) and using some simple celestial mechanics, can compute the heading. A second camera is used at night to take a picture of the stars and get a heading that way. These are very expensive devices and way to hard for the hobbyist to implement as they need to interface to a camera, FPGA, and a DSP to do the digital signal processing. But I am working on a poor man’s substitute. Check out US Patent.

So what is my conclusion? No single sensor can give you what you want. But a combination of sensors (mag, INU, GPS, solar, …) could be merged together to form a good guess of the heading. You just need to figure out the pros and cons of each sensor and use them appropriately. My experimenting continues.

This entry was posted in AVC. Bookmark the permalink.