Calibration Process Brainstorming, Part Deux

My senior design project for my EE degree involved building a realized ANN… 26 years ago. Not sure if back propagation is still used, but the concept is very simple.

If you have enough points, you probably could do just simple linear interpolation between a matrix (array) that contained the error values. So if you had an array with errors for the x axis and another for errors along the y axis, you could interpolate between two points to get the error at any given point. Doing it this way means you can make an adjustment in one spot (say top left) without affecting the calibration in another spot (say top left). If you do curve fitting, changing coefficients has a global affect. It may not be simple to come up with an equation “template” that fits each and every maslow. That’s why i like a simple matrix transformation.

Just throwing an idea here. A tape with known size and pattern could be shipped with the maslow. It’s glued on the working area and then a Raspberry with camera or a smartphone is mounted on the router sled and the calibration process starts.

(the tape idea is stolen from shaper - a closed source “CNC”-router https://www.youtube.com/watch?v=_0clzXWSaCw)

Well, what I was wondering is if you knew if OpenCV had an algorithm to detect error. For instance, the calibration process is expecting it to see the image on the left, but instead it sees the image on the right and then calculate the error as shown in the bottom image…

Drawing3

I think you could do it with OpenCV, but it’s a lot easier if you can use colored circles (shapes can work as well, but the stock algorithms use the SIFT thing which is evidently patented).

  1. Snap pic of frame with the 4 corners marked and a “yellow dot” in the center (make it different from the corners).
  2. Stretch-Warp the image to fit the workspace (corrects for camera shifts – but for best results, shoot everything from a tripod in a fixed spot so at least the errors are consistent).
  3. Ask OpenCV to find the X/Y coordinate of the “yellow dot”, and compare that with where you expected the yellow dot to be (warning: Y is positive-down in OpenCV, and positive-up in OpenGL/Maslow)

It would be really easy to add #3 to the existing code (just call FindHSV after the image has been processed/stretched and figure out the X/Y offsets to put it into “real-world” coordinates (for the “paint image”, the “bottom left” is 0,0 so it’s known…); if you tell me what color you’d like and where you’d like the output, I’ll patch it in for you [normal people wouldn’t even see it unless they had a “yellow sticker” on their router, so leaving the code in shouldn’t be a problem].

Wow… no Mountain Dew for the guy with the router! He’s got steady hands!

2 Likes

the error we are trying to measure is only a few mm across 8’ so we tru to make
the meadurement over as long a distance as possibe so that the error available
to measure is as big as possible

with a tspe measure you are doing god to get to the nearest 1.2 mm

cslipers can go to 0.02mm or so, but only up to 6" or so (unles you start laying
out serious money) so under ideal conditions (is thr bit accurate enough to not
through things off, or is it a bit worn/undersizrd…)

so
tape measure = .5mm over 8’
calipers = 0.02mm over 6" = .32mm over 8’

the big problem is how do you measure things accurately enough to make your
calculations

.5mm from a tape measure is doable
.02mm from a calioer is optimistic
.5mm from a csmera requires a 5mp camera, no lens distortion, no angke on the
image
the patterned tape has the same problem, plus are you sure you didn’t lay the
rape down crooked?

the key so far has been to figure out what is causing distortions, looking for
places where the error gets multiplied and measuring the multiplied error to the
best of our ability to calculate what the origiinal error was.

Just to make sure I’m clear, I’m not suggesting taking from a distance far away. What I’m suggesting that it might be feasible to increase accuracy substantially (and localized) by taking pictures of close-in of a predefined registration pattern to calculate error. At this point, I’m not considering this to be a stock technique. It’s optional like a unistrut frame. You can get a vinyl sheet 4x8 printed out with a registration pattern for approximately $75 (one offs but get cheaper in bulk). So, in the most basic terms, assume this is what’s printed and applied to the workpiece:

Next, a usb camera is attached to the sled, centered to be exactly where router bit is. Maybe its a jig that fits into the router collet or a piece that is slid in place of the router motor. The key is that the camera is close to the surface of the vinyl sheet. The calibration routine moves the sled to spot 1 (top left) and takes a picture. The software then calculates the amount of error between what is expected and the picture shows. OpenCV seems to have a few ways to do this (template matching being one).
Drawing3

GC then stores this error into an array. It moves to the next registration point and repeats the process until it produces a complete map of the workarea. This process is completely automated.

Then, when you go to cut something, GC uses this array of error values and interpolation to alter the coordinates sent to the controller to account for the error.

I don’t think you need a 5 MP camera to do this. I got a cheap usb microscope off amazon for $30 and I use it to help me repair electronic circuits. It’s resolution is way higher than needed to accomplish this considering the pictures will be taken mere inches from the registration sheet.

This process eliminates human measurement… no tape measure and no calipers. However, what I would suggest is that this could augment the current calibration model. It would make implementing this easier to do if the machine was somewhat close to accurate. You can’t really do this without reasonable values for distancebetweenmotors and rotationalradius already established.

I also have another idea that uses the router and router bit and measures the distance between a registration point and the tip of the router bit with a camera mounted in place of the clear shield…this would eliminate aligning the camera with the router bit, but would involve more computation and I’m not sure how accurate OpenCV could be to calculate x,y deltas…

Drawing5

3 Likes

Ah… ok. That’s not bad. I wonder if we could use something like https://thd.co/2C3SpMs (polka dot wallpaper) as the calibration standard…

1 Like

I did think about wallpaper but I don’t think it comes in 4-foot wide rolls. Ideally, it would be as easy as unrolling the sheet and clamping it to the workpiece. Having to align multiple sheets would start to be a pain. I see this potentially as a repeatable process so if later, because its now summer instead of winter and your frame has “changed”, you could redo the process.

1 Like

Gotcha. “Wide” wallpaper is 27"… getting a reusable banner is a better idea.
eg (but this was just me finding something after finding OfficeDepot doesn’t do that large): https://www.printastic.com/vinyl-banners/sizes/4x8/

Yep, that’s one that I found. So I think its doable… I’m confident the camera-in-place-of-router-bit method could work… not sure about the camera-looking-at-router-bit method could be done easily (i.e., how is it done using something like OpenCV)

Might find something 4*8ish and cheaper in paper tablecloths e.g. https://www.walmart.com/ip/Christmas-Kids-Activity-Table-Cover/46905198 is current $4, perhaps if one person could accurately measure the distances between some known points and share them…or maybe this: https://www.partycity.com/red-gingham-plastic-table-cover-18599.html?cgid=tableware-serving-table-covers&start=7 or this: https://intl.target.com/p/tablecovers-dots-spritz-153/-/A-50082661#lnk=sametab

2 Likes

Good find… i think the last one might work for the first technique (camera in place of router bit). I personally think if we could do the second idea (camera looking at router bit), it might produce better results as it would eliminate the error between where you install the camera and where the router bit really is. However, maybe that error wouldn’t affect accuracy other than where the cut is made on the workpiece. And being off left/right/up/down by a mm or two on the board isn’t that big of a deal if cuts are still made to the correct dimensions.

The second option requires the challenge of calculating something like this:

Drawing8

The software needs to measure distance in a way to account for the perspective… much harder to do I think. maybe that’s calibration process brainstorming, part tres.

Fedex will print up to 3 foot wide (choose any length) and should be relatively local to most US users: http://www.fedex.com/us/office/oversized-prints.html

What aboot 4x8 pegboard?

1 Like

Here is one thought:

You can buy sheets of 1/4" plywood that are pre-marked with dots, where you are supposed to put the screws. I don’t know how precisely they are marked. It might be an option. On the topic of “how precise is the print”, there might be a workaround.

I don’t know if anybody here has read, or is aware of the book, “Foundations of Mechanical Accuracy”. It is very old, and much of it is not very useful. The general concept of the book covers: what strategies can be used to develop a highly precise machine, given imprecise tools. The simplest example of this is: how to create a straight-edge. There are methods which enable you to create extraordinarily precise things, starting from nothing. Google “how to create a straight edge”. There are you-tube videos. Methods like this could create a precise calibration in the absence of a, “gold standard”.

Sounds like my kind of book. I’ve often wondered how we (as a society) ended up with making something precise without precision tools. I’ll definitely look it up.

That might work also… good idea… it’s more durable than a table cloth and substantially cheaper than a custom vinyl sheet… but not as “foldable” :slight_smile:

1 Like

It is old. There might be a newer book that is more applicable today. Let me know if you learn anything.