Surface Flatness from sensor probing data

11 views (last 30 days)
Hello,
I have the following probing data which I got through probing a 3d printer z-axis sensor. I plot the data on a surface and as can be seen that the surface is not flat, so I wanted to find from this data, the flatness of the surface. Does anyone have an Idea how can we find Surface flatness?
Note: Whenever we probe the printer it firstly does homing and set point 32 as home and then starts probing through all points and takes point 32 as a reference point.
Pos 0 1 2 3 4 5 6
0 -0.248 -0.138 -0.068 -0.028 -0.02 -0.048 -0.098
1 -0.222 -0.123 -0.062 -0.018 -0.018 -0.028 -0.078
2 -0.207 -0.11 -0.043 0.015 0.01 -0.01 -0.053
3 -0.25 -0.135 -0.068 -0.03 -0.02 -0.018 -0.083
4 -0.248 -0.162 -0.095 -0.053 -0.045 -0.043 -0.095

Answers (1)

Anurag
Anurag on 25 Oct 2023
Hi Hardikkumar,
I understand that you want to calculate the “straightness” of your surface, or in other words, how deviated is it from a ground truth plane. You could do it by defining a straight plane from any of a fixed coordinate and then checking for the deviation from each point or the best-fit plane.
Here are the following steps to do the same:
  • Choose a reference plane. You mentioned that the point at (3, 2) is the reference point. You can consider this point as the reference plane's height.
  • Calculate a best-fit plane for the entire surface. This plane should minimize the deviations from the measured points.
  • You can use methods like linear regression or polynomial fitting to find the equation of the plane.
  • For each point on the surface (excluding the reference point), calculate the vertical distance from the point to the best-fit plane.
  • The deviation is the absolute difference between the measured height and the height predicted by the best-fit plane.
  • To quantify the flatness, you can calculate statistics such as the maximum deviation, average deviation, or root mean square (RMS) deviation of all points.
Hope this helped.
Some relevant links:
Regards,
Anurag

Categories

Find more on Interpolation in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!