Object depth tracking with magnetometer
8 views (last 30 days)
Show older comments
Hello,
I have a 3-axis magnetometer and a small plastic box of known size. The magnetometer is fixed to the bottom of the box, and I am trying to track the depth of the object within the box, which I have been able to successfully do by recording the magnetometer values for the Z-axis at known positions, finding a calibration curve, fitting an equation, and then solving the equation in real-time for depth.
However, the issue I have is that the magnetometer values for the Z-axis (depth) change if the object moves horizontally (in the x or y plane). Therefore, unless the object is directly in the position in which I made the calibration curve, the depth readings become inaccurate. So my question is, would anyone have an idea of how to ensure the depth readings can be consistently accurate even when the object moves horizontally?
Thanks.
0 Comments
Answers (1)
Image Analyst
on 8 Jan 2024
Since you don't know how the Z values change, you'll have to model that. So I'd map out a 3 by 3 (or more) grid that covers the possible locations laterally of the object and make up 9 calibration curves. Then knowing the (x,y) you can use scatteredInterpolant to get an estimate of the curve for that particular location. I'm including a demo of scatteredInterpolant.
0 Comments
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!