0

There's an accelerometer in the IMU. The output can then be integrated to estimate the position, at least in theory.

But in practice, there's a huge acceleration from gravity, which varies rather randomly across locations. Vibrations etc can be filtered out with low-pass filters, but how do you filter out gravity? Is it simply the case that the vertical vector is ignored when doing any calculations?

My application is, I want to build a quadcopter that could hover in one place even in the presence of (reasonable) winds: the quadcopter ideally would tilt towards random gusts to maintain a certain position. Every single tutorial I could find on the Internet only uses the accelerometer to estimate where down is when stationary, and simply assumes that using the gyroscope to hold the quadcopter level is enough.

I also want to use the IMU to estimate altitude if possible, of course as an input to something like a Kalman filter in conjunction with a sonar system.

Obviously, for my application GPS is far too slow.

Gürkan Çetin
  • 411
  • 2
  • 17
ithisa
  • 101
  • 2
  • Not try to be rude, but what exactly is your question? Are you asking how to filter the noise out of accelerometer readings? – Chuck Jun 09 '15 at 01:25
  • I will rephrase my question. My biggest question is how to filter out gravity actually. – ithisa Jun 09 '15 at 01:30
  • Why you want to filter out the gravity? The gravity vector can be used for attitude estimation by vector projection. With the gravity vector alone you can easily estimate the pitch and roll. If you even take the magnetic field vector you can apply the so-called "bi-vector" method. In general a vector projection to estimate the attitude of the quadrocopter. – TobiasK Jun 09 '15 at 05:53
  • didn't read all your questions. But for filter out the gravity: use a high-pass filter on accelerometer. As what Android does: http://developer.android.com/reference/android/hardware/SensorEvent.html#values – lanyusea Jun 09 '15 at 12:24
  • another maybe better idea is the step detection algorithem, but can only detect there happened a movement/vertical instead of finding its direction. To do it, calculate the total magnitude of acceleration on three axis, then minus 9.8, and set a threshold to detect whether there is a movement or not. – lanyusea Jun 09 '15 at 12:28
  • @Ianyusea - You are providing answers; you should put those answers in an answer and post the answer to the question. Please do not put answers in the comments section. – Chuck Jun 09 '15 at 13:15
  • @TobiasK Of course I don't want to filter out gravity when doing attitude estimation. I would certainly need to filter out gravity when trying to estimate 3D position by dead reckoning, no? – ithisa Jun 09 '15 at 14:19

3 Answers3

2

To "filter" out gravity is not necessarily the correct terminology. The accelerometer measures all forces acting on it, so when it is stationary the only force is gravity. However, because the accelerometer may not be level, the gravity force might not be directly on the Z-axis (assuming Z axis is representing the vertical). Usually a gyroscope is used along with the accelerometer to level the acceleromter, this way the gravity force can be directly subtracted from the accelerometer readings.

user11356
  • 121
  • 2
1

Most flight controllers that I am aware of do not use the IMU for absolute positioning they are only used for attitude estimation and in some cases to try to dampen the effects of external forces (i.e. wind) but it can only be effective at damping these external forces if they are above a certain reasonably detectable level so over the long run you will drift quite a bit but in the short run you can somewhat compensate for the effects of wind.

If you need more robust position holding you might be better off using another system in conjunction with the imu like an optical flow sensor and a target dot or good old gps.

What is your target application?

Mark Omo
  • 1,919
  • 13
  • 23
0

See also this question for some info on how accelerometers handle gravity versus an external force.

Ben
  • 5,855
  • 3
  • 28
  • 48