As Rocketmagnet mentioned your error is going to grow with time. The error model typically used in inertial navigation is an exponential growth.
To minimize this you must provide external updates. The mechanism typically employed is a Kalman Filter. The inertial sensors provide very good high rate updates. Your external source provides less accurate but long term stable updates at a lower rate (typically something like GPS). These two combine to give you a good combined solution. Not all systems use GPS as the update source. For instance, the IR imager on the front of the Nintendo Wii remote provides the source of these updates.
I'll give you an example of the cost is no factor side of things. I build systems for aerial surveying that utilize inertial systems that cost 100,000+ Euro. With these systems and high end geodetic GPS receivers I can pin-point the location of the IMU to a 2" volume all day long when GPS coverage is good. In the absence of GPS updates (urban canyons, tunnels, etc.) after about 60 seconds we have an error margin of about 10cm. Systems with this level of performance are typically ITAR controlled goods as they are weapons grade devices.
Lower quality MEMS inertial systems are used all day long in less demanding applications yielding meter sub-meter level position and attitude. These lower quality systems still employ the same Kalman Filtering mechanism. The real downside to these lower cost units is that your drift error will grow at a much faster rate.
Edit:
To answer your question as to what is important to look for in an IMU. There are a couple of things you want to look at. The first is temperature stability. Some MEMS sensors are going to have outputs that vary by as much as 10% over temperature range. These may not matter if you are at a constant temperature during operation.
The next thing to consider is the gyro noise spectral density. Obviously the lower the noise amount the better. The following link provides documentation about how to get from the spectral noise density to the drift (in degrees per unit time). http://www.xbow.com/pdf/AngleRandomWalkAppNote.pdf
For acceleration you want to look at sensitivity, and bias in addition to the noise. The noise level will give you an idea of how quickly you're going to integrate error.
You can low-pass filter an accelerometer signal. The gravity vector is at DC. Using a 2-axis accelerometer like the Analog Devices ADXL202 should be sufficient for a plane.
Here's an excellent article on all the math.
what happens if the user suddendly moves the plate forward?
You are confusing the concept of translation (change in position) with attitude (orientation). If the plate moves suddenly forward (pure translation) then you, ideally, want to see no change in the output (the attitude didn't change).
If the user suddenly tilts the plate forwards then after an infinite time period the DC value will also correctly and exclusively reflect this change.
An accelerometer measures acceleration. Acceleration is caused by force. Gravity is a force. Gravity is based on mass relationships, separation distance, and the angle between the vectors. Since neither the plate's mass or the Earth's mass is changing, the separation distance is (for all intents and purposes unchanging), for a specific angle (tilt) gravity is a constant force. Things that are constant have 0 frequency (e.g. "DC").
Any given tilt angle will correspond to one (and only one) force vector on the plate through 180 deg.
The problem in a practical system is that you can't wait an infinite amount of time to notice that the attitude has changed. So you must, like everything in engineering, compromise between the requirements. That is why I suggested the approach of a low-pass filter. Where you corner the filter will determine the trade-off between selectivity and accuracy (in the short term).
In practical systems you can corner somewhere around 10Hz and usually do ok (most cell phones take this approach).
link you provide assumes a three axis accelerometer
The third axis is only absolutely required if you need to detect yaw (via gyro) or disambiguate attitude through both hemispheres (via accelerometer), which the original question seems to explicitly discount as undesired motion. If that assumption on my part is in error, the OP can use a 3-axis accelerometer or 2-axis + 1 axis gyro as desired. That is why I said "should be sufficient."
I'd go with a gyro...
If you are trying to minimize cost/power, then using a gyroscope by itself is a poor choice with respect to the accelerometer as proposed. In the tilt sensing application you described, the gyro develops a tilt error that continues to increase without bound as it measures only rotational accelerations, which you must integrate to find the position (tilt).
When you tilt the gyro you'll see a change in the output voltage, but it quickly returns to it's resting level if the new attitude (tilt) is held. This leads to two undesirable problems:
- It becomes extremely sensitive to jostling (shaking and other transient disturbances)
- Error accumulates very quickly and must therefore be "reset" to some known value every so often by correlating it with some other data source (such as the accelerometer as proposed).
Here is data from an experiment conducted by David Anderson on his self-balancing robot:
Note how the error (difference between the blue line and red line) quickly runs away from the ground-truth.
In contrast, the accelerometer measures tilt directly so error does not accumulate. In the gyro, each estimate of tilt is a function of all prior measurements (error accumulates). In the accelerometer, each estimate of tilt is based on only the current reading (to the first order).
Best Answer
I agree with one of the above replies in that you need something (probably two accelerometers) to detect the angle at which the cane stands (calibrated at the factory if you are industrializing this). This way you have a continuum of what angle the cane is at, relative to upright.
This gives a distinct advantage over a simple tilt switch for the following reasons. 1. You can calculate the angle with two accelerometers. With a tilt (on/off) switch, you cannot 2. Not only can you calculate the angle with two accelerometers, you can detect the rate at which the angle changes relative to the cane standing up straight. This is key as you can then at least have the information to characterize what the rate of fall looks like by a simple drop test and base your fall detection algorithm model on that.