Automated measurement of Z axis perpendicularity

This is how it works at the moment.

top

First, the front and back are probed at several points (the red dots). From these points, the center line of the feeler gauge is computed. Then, the probe moves from left to right along the center line until it touches, giving the red dot at the side. This all happens at a single Z coordinate and a single spindle axis angle, so tilt is not relevant here.

This process is then repeated at several Z depths. You get a center line at each depth, and a (vertical) plane is then fitted to these center lines. You also have a “side point” for each depth, and a line is fitted to these points, with the constraint that this line is in the plane that goes through the center lines.

This line is then shifted a couple of mm to the right and extrapolated to a starting point above the feeler gauge. The needle probes exactly along this line. This way, the probe will always hit the center line at the same distance from the side.

The exact XYZ coordinate where the probe triggers is then stored. The spindle is rotated 45 degrees, and the whole process repeats, until a 270 degree arc is made. The stored XYZ coordinates are fitted to a plane, and this plane gives you the tilt of the spindle axis to the XY plane.

The measurements at the front and back at several Z depths can also be used to compute the (vertical) center line of the needle. If you have the center line at 0 degrees and at 180 degrees of rotation of the spindle, the average of those two lines gives you the difference between the Z axis angle and the spindle axis angle. This is what I posted in the first post.

Yes, this is what I’m doing. Currently the script approximates it with a linear taper, and for real needles this is not true. It’s fairly easy to make a better model of a needle and fit that. But linear may be good enough because it is extrapolated only a little bit (1 or 2 mm). I’ll have a look at it when I get some real data from a needle. EDIT: after thinking about it some more, this is not exactly true I think.

With probing on the front and back at several depths and at several spindle axis angles, you can build a complete 3D profile of the needle. When determining the center line at a single depth, any taper automatically cancels out. By using several spindle axis rotations, any tilt or crookedness of the needle cancels out.

I only use one side of the feeler gauge. I don’t use the other side, because other feeler gauges may be attached to it, and you need to mount the gauge. So for the side, taper or crookedness is relevant. The effect of making a wrong assumption here is limited though, because it’s only used to determine the XY coordinate of where to probe on top of the feeler gauge. If the feeler gauge is reasonably well mounted, then a small offset in XY only gives a tiny error in Z. If the needle is tapered but straight, then this error will be the same for all spindle axis angles I think, so in the end there is no error in the estimate of the spindle axis tilt.

The lower noise is a nice benefit.

I plan on using 15-20mm effective needle length. But you can indeed get close to half the Z travel. Also, the arm on the spindle is 150mm. The longer the arm, the higher the precision. But even if you can measure to 0.0001 degrees, doesn’t mean you can actually shim the mount to that precision. And once the router starts moving and cutting, side forces will make things tilt anyway… but at least the ability to measure precisely will not be the limiting factor.

I finally got around to finishing up the script and testing it for real on my MPCNC.

Here’s what the hardware setup now looks like:

It’s pretty simple, just a couple of printed parts and one feeler gauge hooked up to the Z probe. I used a 0.80mm gauge but it doesn’t matter much. You can find the STLs and the code on my github repo for this project.

The script is completely automated. It rotates the arm automatically by keeping the needle against the side of the feeler gauge while moving around it in a circle. It does take about half an hour to perform the whole procedure though…

Also, if you run it, watch the needle to see if the probe always makes good contact. Make sure the probe and gauge are clean. If the probe is not triggered properly, then the router will force the arm to rotate a little and this will throw off the measurements.

Here are the results for my machine:

Spindle angle around X: -0.1563 degrees off perpendicular
Spindle angle around Y: 0.2554 degrees off perpendicular
Z axis angle around X: 0.3192 degrees off perpendicular
Z axis to spindle in X: -0.4756
Z axis angle around Y: 0.1866 degrees off perpendicular
Z axis to spindle in Y: 0.0688

This means that my Z axis movement is off by 0.3192 / 0.1866 degrees. The router is mounted at an angle of -0.4756 / 0.0688 to the Z axis. This gives a total angle of -0.1563 / 0.2554 between the end mill and the XY plane. Pretty good already!

I ran the calibration twice, and the angles were within 0.01 degrees of each other.

The Z axis movement can be compensated in firmware using skew correction. In principe, you could calculate exactly how much to shim the router mount at which point to get it right the first time. I haven’t taken the time to work this out yet though. Not sure if I will, given that my angles are very small already.

5 Likes

I so much wanna test it 'cause the project in itself is awesome but im already horrified by the nubers i’ll get.

Really nice job.

Very nice to hear! Let me know if you run into any issues.

It is a bit tricky to make sure it completes a whole cycle. If the probe does not make perfect contact every time, the arm and needle can be pushed too far and it cannot find the gauge anymore. Or, the needle may crash into something and snap…

I’ve started to work on a GUI to let you do the same procedure but without the ‘automatic rotation’, and with an option to accept or reject measurements. This makes the process more interactive, and also less likely to fail. But a lot of work is still needed to make this a reality.

This really peaks my interest. I know this is not a level of precision that makes sense for the needs of most users and as Ryan says is a “chasing zeros” path.

I think I understand some of how the needle, feeler gauge and rotating probe use the data to measure tilt. By having the needle probe the center of the feeler gauge at different heights you can fit a line to the different heights. Then by moving the router around the probe in a circle your able to filter out all the other things that could be misaligned and work your way back to just the routers misalignment. Is this close?

Has anyone besides Peter tried this? Perter are you still around? I would like to try this on my LR and see what I get.