[From the last episode: We introduced the notion of sensor fusionThe process of combining information from multiple sensors (real or virtual) in order either to give more confidence in a result or to come up with something completely new., where we get more value by combining sensor outputs.]
Today we take our first look at specific sensor-fusion applications: mixing accelerometers and gyroscopesA sensor that detects when it changes direction.. Because this is about determining where we are and where we’re going, there’s one more source of info that we can’t ignore: GPS. (GNSS more generically – Global Navigation Satellite Systems – which covers all the global variants, including the US’s GPSGlobal Positioning System. A satellite system that sends signals to earth. GPS receivers can get those and figure out where on the earth you are. This is specifically a US-based system, an example of the more generic term “GNSS.”.) After all, we’ve been talking about navigation using sensorsA device that can measure something about its environment. Examples are movement, light, color, moisture, pressure, and many more.; isn’t that what GPS is for?
Yes, it is. Let’s cover some background to figure out what’s going on.
GPS can tell you exactly where you are – with some uncertainty (which has gotten better over the years). So it’s not going to pinpoint you to the millimeter, but certainly good enough for getting you from here to there.
But what did we do before GPS? We used speedometers and gyroscopes. (A speedometer is simply a large, old-fashioned variant on an accelerometer, more or less.*) And, frankly, we used paper maps. We didn’t really need gyroscopes because our roads set our direction of travel and orientationThe direction someone or something is facing. This may be different from the direction of motion.. But there are two other vehicles that aren’t constrained by roads: boats and airplanes.
Dead Reckoning
Those two modes of transport have used gyroscopes for a long time. They help with what’s called dead reckoningThe process of determining your position through a series of speed and heading calculations. Small errors can accumulate if your measurements and those calculations aren’t accurate enough.. Let’s look at boating to understand that (if you don’t already). Back in the old colonial days and earlier, sailors could use the stars to tell how far north or south they were. But the earth rotates under the stars, so there are no fixed star positions to tell you where you are east-to-west. So what do you do? You use math.
Trigonometry – the measurement of triangles – to be specific. You know your starting position and you know your heading from your gyroscope. So you go straight for a while at some speed that you calculate as best you can, which tells you where you are now. Then you turn, and you calculate your new heading as best you can, and you go straight for a while, calculating your speed as best you can, and then you know your new position as best you can. This is the process of dead reckoning.
Each of these calculations has a small error, even if you do a good job. The problem is that that small error on your first measurement adds to a small error on your next measurement and all the measurements after that. The error piles up, and, the less accurate your measurements and calculations, the more you aren’t where you think you are after a number of turns and runs. (And this is not even mentioning the effect of wind and currents, but we don’t need that for our point.)
How Accurate is Your Gyroscope?
In theory, you can figure out where you are using the accelerometer and gyroscope in your phone. Or can you? We already saw that gyroscopes suffer from so-called drift – they, just like dead reckoning, pile up errors the longer you use them without any kind of “reset.” So, after a while, your orientation won’t be correct, which means you can’t calculation your position accurately. If you want a so-called navigation-grade gyroscope, you’re going to have to pay wayyyyy more money – like six figures in some cases – and it might not even be MEMS.
So here we are with navigation sensors in our phones that aren’t really up for serious navigation. And so we use GPS to get a better fix on where we are.
When GPS Fails
But the GPS signal isn’t always available. Deep inside a building? There’s no GPS. In fact, you can lose GPS in a parking garage. So you mostly have GPS – until you don’t. Then what? Bear in mind that app designers would really like to build phone apps that can navigate you to an empty parking spot or to a specific store in a mall. It will need your position in places that have no GPS.
So here’s where the sensor fusion comes in. And, in this case, it’s an example of using one set of sensors as backup for another. And we’re going to use GPS as a virtual sensorA source of data that, strictly speaking, isn’t a sensor, but that can be used as if it were a sensor..
Your phone relies on GPS as long as it can. And then, if there’s no GPS? It can turn to your in-phone sensors to do dead reckoning for a while. The hope is that you won’t be moving around for too long without GPS, since you’ll be losing accuracy all the while. Once you get into GPS range again, you’ll know exactly where you are, and you can reset the phone sensors to get rid of all that error and start over when needed.
That’s One Kind of Sensor Fusion
So there you have it: GPS (a virtual sensor), accelerometersA sensor that measures acceleration and deceleration., and gyroscopes working together to get you the best realistic position measurement under any circumstances.
You may also remember from our gyroscope discussion that we can use the accelerometer to wake up the gyroscope in order to save energy. That’s another example of using two sensors together. But note that, strictly speaking, we’re not doing any data “fusing” in either of these cases. We’re just using one sensor or the other, deciding which is the best at any moment. Or we’re one sensor to control another, without combining their outputs in any way.
Next week we’ll look at how we can actually combine outputs for better results.
* A speedometer tells you directly how fast you’re going. An accelerometer tells you how much you’ve accelerated, but, if you know your starting speed, then you know your current speed. For you math mavens, you integrate the acceleration to get speed. And you further integrate speed to get position.
Leave a Reply