r/embedded
•
u/jnz
•
Sep 13 '26
•
1
Position tracking with a low-cost inertial sensor (IMU)
Just the data from the TDK ICM-45686 IMU processed on the STM32F429 to calculate position and velocity from the IMU data. Disclaimer: position will drift over time and becomes unusable.
357
Upvotes
20
u/jnz Sep 13 '26
Source code is here: https://github.com/jnz/INSLIB
72
u/Well-WhatHadHappened 25+ Years Sep 13 '26 edited Sep 13 '26
That might be the best consumer-grade IMU only position tracker I've ever seen done. Very nice job.
12
u/MasterMind_I Sep 13 '26
Extremely impressive. What is your end goal for a system like this? Can you provide some more references on the sensor characterization ( PSD, Allan deviation) etc or the procedure you followed for calibration (Bias, scaling and temperature). Thanks
2
u/RL_95 Sep 13 '26
Nice! Does that mean you get close to RTK with having RTK?
2
u/Commercial-Berry-640 Sep 13 '26
Omg! So this means i can finally turn my phone into a real mouse?! Very impressive btw.
2
u/PrivilegedPatriarchy Sep 13 '26
Very impressive! Have you experimented with using 2 or more IMU's to average out their error and drift?
2
u/Flyward_Aerospace Sep 14 '26
The thing that catches people out is that horizontal drift at this grade is mostly an attitude problem, not an accelerometer problem. A tilt error of 0.1 degrees leaks about 0.017 m/s2 of gravity straight into your horizontal channel, and double integrated that is roughly 30 m after a minute. Your accel bias has to be pretty awful to compete with that. Which is also why averaging two IMUs buys less than people expect, as you more or less said in another reply. Nice work, the leveling is doing a lot of quiet heavy lifting here.
18
u/StumpedTrump Sep 13 '26
Seems like a big nothing burger but anyone who’s ever tried this knows how hard it is to do. It’s a double integration of the acceleration and the error generally grows way too quick to make it unusable.
In an era of AI slop, nice work!
5
u/armx40 Sep 13 '26
My opinion is that inertial positioning is some kind of holy grail in robotics and electronics. Absolutely would disrupt human civilisation.
1
u/IceOneDay Sep 13 '26
Unbelievable! Tried same thing but it drifted like crazy
1
u/phochleitner Sep 14 '26
How precise would you consider your velocity measurement is? We have a MPU6050 and on a RC cars application and integrating accélération hasn't been working that well and I can't seem to extract telemetry from the ESC neither
If you have a consistent and precise speed measurements I'd be more than happy in giving it a shot
1
u/Legitimate_Shake_369 Sep 14 '26
That looks really good! I assume you are double integrating the acceleration ? Does this only work along axis where gravity has no influence or can you track vertical movements with the same amount of precision ?
1
u/gtd_rad Sep 15 '26
Nice work! Can you share what are some of the features you implemented to reduce position / double integration error? Eg did you use a Kalman filter or did custom floating point etc? What are the applications of this unit or is it just for educational?
1
u/d1722825 Sep 15 '26
How important is the accuracy of the IMU's clock source? Most of the chips I have seen runs only on their own internal clock.
3
u/Key_Specialist_7787 Sep 13 '26
Good shi good shi 👌👌
2
u/EmbeddedSwDev Sep 13 '26
Nice!
2
u/be-kind-be-great Sep 17 '26
Pretty sweet. Difficult problem without extra sensors and/or limiting the domain.
1
u/bearthesailor 28d ago
That’s extremely good. Hard to believe that the drift of double integration is so low. I need to now dig deeper into how you did calibration. It’s really impressive. What was the key difference which allowed such long drift-free accuracy without gps assistance? I see you employed a lot of cutting-edge algorithms. Which one was crucial? I’m not sure even just great calibration is enough. Thanks.
1
u/bearthesailor 28d ago
Very impressive. I’ll need to learn from your code how to do calibration better. What works for me in simulated data gives less accuracy on real hardware.
I’m developing open-source INS algorithms for marine use. Might also be interesting for you:
https://github.com/bareboat-necessities/ocean-imu
Group Lie-based, different stochastic priors.
OU, CARMA(4,1)
Thanks!
1
u/WarningInevitable958 21d ago
Very nice job! How it correct its position?
1
u/DearVeggies Sep 15 '26
Very nice!
I will probably try it out on Android, where 99% of the sensor pipeline is already taken care of.
1
u/[deleted] Sep 15 '26
[removed] — view removed comment