# Combining the output from an acceleromter and a rate gyro

Hello.
I'm trying to find a good way to meassure the angle of tilt for a balancing robot. An accelerometer gives me a good angle, when the robot isn't
accelerating, and the gyro gives a good angular rate but causes drift error.
So how do I combine these two signals most effectively to get accurate angles even during acceleration, without the drift caused by integrating the output from the rate gyro?
I've found that some people have used Kalman for this but I'm not sure this is the way to go. The reason I think so is that the accelerometer will be unviable for reading the angle when the robot is accelerating because it will be under the influence of acceleration other than that of gravity (not because it has a lot of white uniform noise). Kalman doesn't really help with that kind of disturbance, does it (admittedly I only have a very basic understanding of Kalman filters)?
When one senses that the robot has tilted ("a lot") from the rate gyro signal then one should be able to use that information to sort of compensate for the extra (non-gravity-induced) acceleration that this would give the acceleromter and simply compensate for it to get a good value for the angle, right? How would the "non-gravity-induced" part of the accelerometer-ouput relate to the gyro-rate?
One idea was to simply adaptively blend between the integrated angle (i.e the last angle value, however it was computed, plus gyro_rate*dt) and the value from the accelerometer. Where the rate gyro's output is high (that is, the system is under a lot of acceleration and the output of the accelerometer can't be trusted) the blend factor would approach 1.0 (meaning all-gyro) and when the gyro's output is low it would approach 0.0 (meaning all-accelerometer). Does this seem like a good approach (and is there any theory as to exactly what blend function is good for this)?
Regards, Sebastian Sylvan
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Why not use a tilt meter?

error.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Noone Home wrote:

A what?
/S