Flawed "Complementary Filter" Theory

Is the "complementary filter" comprising accelerometer and integrated gyro measurements a real representation of what is happening? The theory is that gyro measurements alone are inadequate for doing things like balancing an inverted pendulum so a complementary filter is needed.

But there are two reasons to doubt this explanation. First, a gyro alone can balance a two wheeled robot. I do it all the time. Second, an accelerometer used as an inclinometer must be at rest to be accurate. An accelerometer will measure tilt but if accelerated laterally the tilt measurement will be corrupted. Imagine being in a boxcar and measuring tilt with a plumb bob. Tilt will deflect the plumb bob but so will lateral acceleration.

So, in balancing a two wheeled robot is lateral acceleration significant compared to tilt? The attached pdf shows the result of an experiment to answer the question. An MPU6050 IMU is used for accelerometer and gyro measurements. Independent acceleration measurement comes from quadrature wheel decoders. Recorded measurements come from a robot while balancing.

Measurement blows the complementary filter theory out of the water.

Complementary Filter.pdf (145 KB)

charliesixpack:
First, a gyro alone can balance a two wheeled robot. I do it all the time.

Really? How does the gyro differentiate between lying flat on the floor and upright-balanced?

The filter basically smooths out or averages lateral acceleration before correcting the gyro.

MorganS:
Really? How does the gyro differentiate between lying flat on the floor and upright-balanced?

Why must a gyro differentiate those two cases? In each case the average gyro output is zero. Both cases are stable. I don't see the point of your question.

Upright and balanced is unstable for a 2-wheeled robot.

Upright is stable.

charliesixpack:
Upright is stable.

And what happens when you take away the control system?

...R