Accelerometer question
Accelerometer question
Hello!
I am trying to measure velocity as little as 0.23 m/s with the IMU, but it seems to me that the X8-9 is not very consistent in measuring accelerations this little. Is it worth trying to make it right, or it's useless to expect valid data from it?
Currently I am getting the accelerometer feedback and I multiply it with the elapsed time, but it gives me values between -0.5 to +0.5. I can provide exact data if needed but it seems that the error is bigger than my max velocity
Many thanks
Istvan
I am trying to measure velocity as little as 0.23 m/s with the IMU, but it seems to me that the X8-9 is not very consistent in measuring accelerations this little. Is it worth trying to make it right, or it's useless to expect valid data from it?
Currently I am getting the accelerometer feedback and I multiply it with the elapsed time, but it gives me values between -0.5 to +0.5. I can provide exact data if needed but it seems that the error is bigger than my max velocity
Many thanks
Istvan
- dave_rollinson
- HEBI Official
- Posts: 41
- Joined: Tue Dec 31, 2019 11:58 am
Re: Accelerometer question
If you don't get sensible estimates even for 1 timestep, the problem is possibly that you're leaving in the gravitational component of acceleration in the raw accelerometer reading. But even if you account for that I would expect the results to be pretty poor for anything more than a few timesteps.
There are a number of articles explaining how to do this in various levels of detail. But the overall idea is to get the orientation of the actuator (which is returned in our APIs as a quaternion in feedback), convert to a rotation matrix, then subtract out the 1g gravitational acceleration along the Z-axis in the world frame. What's left is (in theory) your linear acceleration, assuming the orientation is estimated perfectly (which in practice it isn't).
The best way of testing to see if things work well enough for your case would be to use the HEBI Mobile IO app for iOS or Android. Both iOS/Android process the IMU on board to attempt to subtract out gravitational acceleration. The MobileIO app can return either the raw linear+gravitional acceleration or the estimated linear acceleration depending on the app settings. If you set it to just linear accleration you should be able to integrate the feedback directly to see how accurate it is for your application.
Odds are that Apple/Google do a better job of estimating orientation from the IMUs than we do, so that velocity estimate is probably about as good as it gets for MEMS IMUs.
Hope that helps,
-Dave
There are a number of articles explaining how to do this in various levels of detail. But the overall idea is to get the orientation of the actuator (which is returned in our APIs as a quaternion in feedback), convert to a rotation matrix, then subtract out the 1g gravitational acceleration along the Z-axis in the world frame. What's left is (in theory) your linear acceleration, assuming the orientation is estimated perfectly (which in practice it isn't).
The best way of testing to see if things work well enough for your case would be to use the HEBI Mobile IO app for iOS or Android. Both iOS/Android process the IMU on board to attempt to subtract out gravitational acceleration. The MobileIO app can return either the raw linear+gravitional acceleration or the estimated linear acceleration depending on the app settings. If you set it to just linear accleration you should be able to integrate the feedback directly to see how accurate it is for your application.
Odds are that Apple/Google do a better job of estimating orientation from the IMUs than we do, so that velocity estimate is probably about as good as it gets for MEMS IMUs.
Hope that helps,
-Dave
Re: Accelerometer question
Thank you for the reply!
A bit offtopic question, can I get the orientation feedback data with the Python API? I didn't see it mentioned in the docs, as I saw it in the C++ docs
Istvan
A bit offtopic question, can I get the orientation feedback data with the Python API? I didn't see it mentioned in the docs, as I saw it in the C++ docs
Istvan
- daniel_wright
- HEBI Official
- Posts: 5
- Joined: Mon Mar 30, 2020 10:27 am
- Location: Pittsburgh
Re: Accelerometer question
Hi Istvan,
The Python API has orientation feedback available. Relevant documentation is here: https://docs.hebi.us/docs/python/2.2.1/ ... rientation
Sorry that this wasn't immediately clear. Each Python API version has its API reference documentation under the following link on our website: https://docs.hebi.us/docs/python/
I hope this helps.
- Daniel
The Python API has orientation feedback available. Relevant documentation is here: https://docs.hebi.us/docs/python/2.2.1/ ... rientation
Sorry that this wasn't immediately clear. Each Python API version has its API reference documentation under the following link on our website: https://docs.hebi.us/docs/python/
I hope this helps.
- Daniel
Re: Accelerometer question
Very nice, thank you very much!
Istvan
Istvan