# Sensing the gravitational vertical

How might one sense the direction of gravity in a mobile robot? The only method I've thought of so far is a pendulum on gimbals with two
shaft encoders on the gimbal hinges, the whole mounted in an oil-filled chamber to damp out oscillations. Alternatively, inspired by the semicircular canals in the inner ear, one might use mercury flowing in a circular tube mounted in the vertical plane, but mercury is fairly nasty stuff to work with. Load cells in the feet or wheels would work while the robot is stationary, but when it's moving, it might not be possible to disentangle the gravitational signal from the forces due to the robot's own acions.
--
Richard Kennaway

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Trouble with pendulum type device is robot inertia at start and stop, turning left and right. Same problem in an airplane that is why aircraft instruments rely on gyroscopes. Miniature gyros have been in military stuff for ages and you should be able to get them from surplus, cheap. Let us know!
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
snipped-for-privacy@cmp.uea.ac.uk (Richard Kennaway) writes:

It's close enough to impossible not to worry about trying. Force due to gravity is indistinguishable from acceleration without compensation for known changes in velocity (with wheel encoders or the like).
Much more practical is to sense "down" while stationary, and then use rate-sensing gyroscopes to keep track of changes while moving. The gyros can be found by looking for R/C helicopter parts.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
snipped-for-privacy@cmp.uea.ac.uk (Richard Kennaway) wrote:

The issue there is that the pendulum will move in response to acceleration of the robot as well as the acceleration due to gravity. The oil will change how it moves, but not stop it. So without more sensors to tell you the acceleration of the robot, you can't produce a very accurate answer for the gravity vector. Of course, the error is limited by the amount of acceleration the robot will experience and if that's small enough, then the error might also be small enough for your needs.
I've wondered if using two pendulums of different lengths might give the information needed to calculate both gravity and linear acceleration (in two dimensions at least). I've never tried to work through the math to see if that was true.
--
Curt Welch http://CurtWelch.Com /
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Richard Kennaway wrote:

I'm under the impression Sir Isaac says you can't do this: acceleration and gravity appear to a moving object as the same thing. Therefore, no mechanical arrangement will be able to tell the two apart.
That said, assuming the robot is moving laterally most of the time, an arrangement of several accelerometers at different axes could be interpolated to determine the attitude of the robot, even if it's moving. These are fairly cheap these days, including some 3-axis models with serial outputs. Parallax, among others, sell these for about \$50. Integrating one or more accelerometers with a rate gyro has also proven to be useful. Look at the several self-balancing robots that are demonstrated on the Internet. These maintain a balance while in motion. You're not looking to do a self-balancing robot, but the physics is (are?) universal.
-- Gordon
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Forgot to also mention there are some nice miniature rate gyros that have been successfully used on small bots. The ones from Analog Devices use a ball grid array connection scheme that is very difficult for the average person to solder. Fortunately, a couple of outfits sell modules where the gyro chip has been mounted on a small board, and then you connect them up using standard 0.100" headers.
Look up the Analog ADXRS300. Analog sells an eval board, as do some third-party outfits.
-- Gordon
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
dpa wrote:

That's a good reference. That's how it's done, and it's all there in one short paper.
But for the inclinometer, use a solid-state accelerometer chip. They're smaller, cheaper, and don't slosh. The electrolytic things are 1980s technology.
John Nagle
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
John Nagle wrote:

Absolutely correct.
The sensor currently used on my nBot balancing robot
<http://www.geology.smu.edu/~dpa-www/robo/nbot>
is a commercial version, the FAS-G by Microstrain:
<http://www.microstrain.com/inclinometers.aspx
which does this very thing.
Ted Larsen has also offered his less expensive home-brew version, or did at one time, from
<http://www.ctgnet.com/
The sourceforge autopilot project has some good information:
<http://autopilot.sourceforge.net /
and <http://rotomotion.com/ also has the hardware available.
dpa
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Richard Kennaway wrote:

Not sure why everyone is suggesting gyros - MEMS accelerometers are cheap, and made for this task. Of course as others have pointed out, acceleration is extremely hard to differentiate from gravity.
If you would like, free of charge, one or two ADXL322 2D 2G accelerometer chips to play with, send me your mailing address by email. Please download the datasheet from Analog Devices first and decide if you can solder to these devices; they are in QFN package.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
snipped-for-privacy@gmail.com writes:

Not speaking for anybody else... but gyros are certainly what come to my mind first when the question of detecting angular change comes up, and the R/C helicopter community uses them a lot.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Joe Pfeiffer wrote:

For angular acceleration - yes. For linear acceleration, which gravity is, an accelerometer is the weapon of choice.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
snipped-for-privacy@gmail.com writes:

The OP was worried about keeping track of vertical while moving, and specifically mentioned the problem of disentangling gravity from other accelerations. For that task, you'll have to do a lot to convince me that accelerometers alone are better than my original suggestion of doing "something" (which I left unspecified; accelerometers would be fine) to sense vertical when stationary, and then use gyros to keep track when moving.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Joe Pfeiffer wrote:

Integrating the gyro inputs with sufficient accuracy is highly nontrivial. I would suggest using the accelerometer, calibrated for the 0 degree roll/0 degree pitch case, and apply a correction factor based on the current drive outputs, whatever they might be. A nominal correction curve can be determined experimentally with not much difficulty.
A real inertial navigation system can of course be realized with 3-axis accelerometers and 3-axis gyros but inaccuracies are cumulative. It depends on the motion patterns being considered. If this is a boat, the task is very difficult because there's no such thing as "still". If this is a wheeled robot moving around hard surfaces, it's easy to stop for a moment, assume that g is the only force acting on the vehicle, and recalibrate. If it's moving through sand dunes, that might not be such a valid way of proceeding.
You could always use a high-resolution camera and perform celestial navigation ;)
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
snipped-for-privacy@gmail.com writes:

We have a Plan!
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Joe Pfeiffer wrote:

What's about a pendulum? Or a kind of water-level?
Ciao, Oliver
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

There are many technologies that can reliably detect the direction of gravity if you're not currently accelerating in some other direction. Things like pendulums have problems because they take a while to settle. Things like water levels are hard to read electronically. Accelerometers really are easy and reliable for a stationary platform.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002