Using camera and a tape measure check and adjust steps per mm

Hi all

Here is my way to check that the machines moves accurately and steps per mm are correct
Mount a camera and use it to look at the tape measure. then jog the machine back and forward and make sure that if you move the machine 1m then the tape measure also shows the same distance

My setup:

  • LR4 with jackpot
  • webcam connected to a raspberry pi
  • a script running on a pi serving a page that shows the camera with a crosshair
  • tape measure sitting on the bed

measurements:

  • use the camera to align the tape measure to one of the axis. X in this case. jog back and forward and move the tape until it is aligned

  • jog to the start point and zero the X

  • zero the X and write down the reading on the tape

  • move the X given amount and compare the tape reading

  • if the reading on the tape does not match then jog by 0.1mm to find the difference

  • do the math and update steps per mm

    you can see on the screenshot that the crosshair lands not on the mark but a little bit off before the calibration

if anybody is interested i can share the script that you run on the pi that serves the page with crosshair and magnified middle of the frame

I was really impressed that on the Y axis my movement is only 0.1mm off at Y+2400mm according to the tape.

Hi!

Very nice and clever setup!

I would love to have your script! :heart:

This is interesting… nice thinking outside the box.

here you go zerg32/CameraCal . ignore everything else in this project except the stream_server.py and setup script. I was trying to make a full camera based calibration using opencv but failed to find a way to make the calibration patterns accurate enough

Great!

Thank you very much!

I will setup a new raspberry pi and give it a try as soon as my table for my Lowrider is ready for calibration.

Hi again!

Just some fast feedback from me. I couldn’t wait for my table to be ready. I just installed your script on a old laptop I want to use as workshop computer.

And after approx. 5min it worked like a charm.

I just gave it a test on my sewing table. :wink: And now I need a somewhat better camera. This one can’t focus near enough.

your current one does not support auto focus at all :frowning: it will tell you if it can control auto focus near the resolution drop down.

Yes, I know, I bought it in the corona years for our D&D sessions. It’s a cheap one.

I will take a look at amazon for a better one! :wink:

With a new optained camera, focus is now spot on…

It’s still a very cheap camera - yes, I don’t learn from my mistakes - but focus is fine now. Brightness is a problem, but it’s now good enough for me.

If you have another USB port you can add a tiny USB light to brighten it up.

I use a flashlight! :wink:

But it must be something software related. If I check the camera with “camera”, the image is just find and bright.

When I hit “Autofocus & Expusure”, the images gets bright and well focused. But at the end, it goes dark again.

But that is no problem for me. I will use the camera most the time in home office and for playing D&D.