ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Tue, 09 May 2017 04:32:31 -0500Reading from an IMU (single axis)https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/How do I use the single axis accelerometer (one in the single axis IMU) to measure linear velocity (and hence linear distance covered)?
Mon, 25 Mar 2013 05:26:46 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/Answer by Claudio for <p>How do I use the single axis accelerometer (one in the single axis IMU) to measure linear velocity (and hence linear distance covered)?</p>
https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?answer=59137#post-id-59137Basic answer: **you don't**.
The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.
Accelerometers are **never** used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.
All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.
If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.
It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...
**Detailed explanation as to why this is the truth about MEMS sensors.**
Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.
A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using *huge* sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check [wikipedia](https://en.wikipedia.org/wiki/Accelerometer#Structure)).
MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.
This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.
So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).
This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the time I ask you. The longer the time I let you walk, the worst estimate you'd be able to give.
And there is no way you can solve that, as you don't have anything by which to reference your position. The same thing done in a town would go much better as you can use buildings, posts, signals, colours, shapes and whatnot to better place yourself. Even if you didn't know the place, you'd at least be able to know the distance walked, the turns taken, and guess at your position with a fair degree of accuracy.
MEMS sensors are just not made to give the kind of long term accuracy needed for position estimation (which is made by integration), should you trouble yourself to have a look at the kind of compensations which is needed to get decent results have a read at this paper: [Error Reduction Techniques for a MEMS Accelerometer-based Digital Input Device](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.140.8993&rep=rep1&type=pdf).
I hope this suffice as a detailed answer.
It all depends how you look at the results: if you want to plot the course of an airplane, a MEMS IMU is just not made for that; if you want to track the last few tens of meters walked by a downed firefighter to find him and save him, MEMS IMUs may be the best solution.Mon, 25 Mar 2013 07:11:06 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?answer=59137#post-id-59137Comment by Martin Günther for <div class="snippet"><p>Basic answer: <strong>you don't</strong>.</p>
<p>The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.</p>
<p>Accelerometers are <strong>never</strong> used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.</p>
<p>All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.</p>
<p>If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.</p>
<p>It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...</p>
<p><strong>Detailed explanation as to why this is the truth about MEMS sensors.</strong></p>
<p>Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.</p>
<p>A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using <em>huge</em> sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check <a href="https://en.wikipedia.org/wiki/Accelerometer#Structure">wikipedia</a>).</p>
<p>MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.</p>
<p>This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.</p>
<p>So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).</p>
<p>This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the ...<span class="expander"> <a>(more)</a></span></p></div>https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61833#post-id-61833Wow, great answer, Claudio! Maybe to add one more thing: Since MEMS IMUs alone are very bad at estimating traveled distance, you need to add other sources of information to your EKF, such as wheel odometry (which is typically rather good at estimating distance, and rather bad at estimating rotation)Tue, 30 Apr 2013 01:14:36 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61833#post-id-61833Comment by Claudio for <div class="snippet"><p>Basic answer: <strong>you don't</strong>.</p>
<p>The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.</p>
<p>Accelerometers are <strong>never</strong> used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.</p>
<p>All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.</p>
<p>If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.</p>
<p>It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...</p>
<p><strong>Detailed explanation as to why this is the truth about MEMS sensors.</strong></p>
<p>Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.</p>
<p>A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using <em>huge</em> sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check <a href="https://en.wikipedia.org/wiki/Accelerometer#Structure">wikipedia</a>).</p>
<p>MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.</p>
<p>This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.</p>
<p>So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).</p>
<p>This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the ...<span class="expander"> <a>(more)</a></span></p></div>https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61851#post-id-61851Great idea Martin, although I didn't envision an answer as a comprehensive tutorial on position estimation ;)
Well maybe if i find the time...Tue, 30 Apr 2013 04:28:25 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61851#post-id-61851Comment by McMurdo for <div class="snippet"><p>Basic answer: <strong>you don't</strong>.</p>
<p>The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.</p>
<p>Accelerometers are <strong>never</strong> used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.</p>
<p>All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.</p>
<p>If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.</p>
<p>It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...</p>
<p><strong>Detailed explanation as to why this is the truth about MEMS sensors.</strong></p>
<p>Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.</p>
<p>A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using <em>huge</em> sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check <a href="https://en.wikipedia.org/wiki/Accelerometer#Structure">wikipedia</a>).</p>
<p>MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.</p>
<p>This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.</p>
<p>So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).</p>
<p>This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the ...<span class="expander"> <a>(more)</a></span></p></div>https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61225#post-id-61225Then what use is the IMU in measuring distance? Does it only measure angular twist (using the gyro) and nothing else? Then, of what use is the accelerometer present in the IMU. Please explain.
How does an EKF improve drastically when you include an IMU?Sun, 21 Apr 2013 06:07:02 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61225#post-id-61225Comment by McMurdo for <div class="snippet"><p>Basic answer: <strong>you don't</strong>.</p>
<p>The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.</p>
<p>Accelerometers are <strong>never</strong> used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.</p>
<p>All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.</p>
<p>If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.</p>
<p>It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...</p>
<p><strong>Detailed explanation as to why this is the truth about MEMS sensors.</strong></p>
<p>Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.</p>
<p>A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using <em>huge</em> sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check <a href="https://en.wikipedia.org/wiki/Accelerometer#Structure">wikipedia</a>).</p>
<p>MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.</p>
<p>This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.</p>
<p>So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).</p>
<p>This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the ...<span class="expander"> <a>(more)</a></span></p></div>https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=64184#post-id-64184Great Answer! Thanks!Sun, 02 Jun 2013 20:57:22 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=64184#post-id-64184Comment by Claudio for <div class="snippet"><p>Basic answer: <strong>you don't</strong>.</p>
<p>The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.</p>
<p>Accelerometers are <strong>never</strong> used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.</p>
<p>All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.</p>
<p>If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.</p>
<p>It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...</p>
<p><strong>Detailed explanation as to why this is the truth about MEMS sensors.</strong></p>
<p>Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.</p>
<p>A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using <em>huge</em> sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check <a href="https://en.wikipedia.org/wiki/Accelerometer#Structure">wikipedia</a>).</p>
<p>MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.</p>
<p>This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.</p>
<p>So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).</p>
<p>This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the ...<span class="expander"> <a>(more)</a></span></p></div>https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61830#post-id-61830I've extended the answer, hope it helps you understand the problem.Tue, 30 Apr 2013 00:48:46 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=61830#post-id-61830Comment by TwoBid for <div class="snippet"><p>Basic answer: <strong>you don't</strong>.</p>
<p>The relation from acceleration to space is a double integral, this means the second integral is integrating the error in the first which you can't eliminate.</p>
<p>Accelerometers are <strong>never</strong> used alone to measure space.
You could obtain a decent estimate for around 100m, no farther than that.</p>
<p>All of this is valid for MEMS, other technologies (like ICP) respond differently, but the double integration error is inherent in the math behind it all.</p>
<p>If you simulate it in matlab by moving a point by its speed, deriving acceleration and then integrating acceleration two times to obtain space, you'd see the estimate will drift hugely over time.</p>
<p>It would drift even if you'd use the acceleration instead of the speed, only the simulation would appear much more reliable than the real thing because you would not have all the noise that affect the various processes in a real system. Unless you simulate it that is...</p>
<p><strong>Detailed explanation as to why this is the truth about MEMS sensors.</strong></p>
<p>Every sensor has its pros and cons. MEMS accelerometers are misleadingly named: they don't really measure accelerations, rather they measure the direction of the gravity vector. This measure is often used to correct the bias of MEMS gyros which tend to accumulate during integration.</p>
<p>A proper IMU, as those found in military systems or civilian passenger jets, is a bulky, powerthirsty thing using <em>huge</em> sensors like mechanical gyroscopes (real rotating mass) or laser ones and real accelerometers made with displaced masses (check <a href="https://en.wikipedia.org/wiki/Accelerometer#Structure">wikipedia</a>).</p>
<p>MEMS accelerometers on the contrary are way too small and subject to noise, just like MEMS gyros: if you blindly integrate a gyro's signal, you'll end up with a big accumulated error very fast. Should you do the same with a MEMS accelerometer, integrating to get the speed, you'd also get to an unrecoverable error very fast.</p>
<p>This is due to the inherent nature of the mechanics involved: these kind of sensors are accurate in the transients, but have very noisy steady state ouputs. Such sensors are, by design, suitable for instantaneous measurement rather than accumulated data.</p>
<p>So in 6dof system the Kalman filter family greatly benefits from the fusion of accelerometers and gyroscopes because this fusion yields a very accurate 6dof estimation but don't let the names mislead you: 6dof system means it has 6 degrees of freedom, it doesn't mean it gives you accurate measurements on 6 degrees of movements.
Actually what you end up with is a pretty noisy and rough estimate on 4 (the 3 translations and the z rotation) and a very accurate one on 2 (the x and y rotation).</p>
<p>This is much akin to human capability: if I put you in a desert and tell you where you are, than wait some time while you walk and then ask you for your estimation of your position, the degree to which you diverge from the actual position depends utterly on the ...<span class="expander"> <a>(more)</a></span></p></div>https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=261366#post-id-261366Why is the z rotational (yaw) error noisy?Tue, 09 May 2017 04:32:31 -0500https://answers.ros.org/question/59121/reading-from-an-imu-single-axis/?comment=261366#post-id-261366