Maslow Home Maslow Community Garden Newsletter

Optical Calibration Demo and Three Hours Working on a Bug

I threw a quick model together in onshape at
https://cad.onshape.com/documents/31d35bf799082a5bca8fdc2f/w/0377ac7955565c6837af4c28/e/df5578cd439c6e23aaf4d56a

this is setup for 5" hole spacing, but nothing in this setup is sensitive to the
spacing.

this shows things in the positions for drilling the first, second and third
holes (steps 1-5) and you can see the jig alone in the parts studio and see the
large hole jig with router-like-thing on it. hopefully you can see how the
complex pin would work with a 3/4 hole vs a 1/4 hole

note, this approach works equally well with 6mm and 20mm holes

David Lang

I haven’t had a chance to review the video and assume there’s no cumulative error built up… But any regular pattern will work, however you get it.

Yes, one difficulty I ran into with holes was that there wasn’t always a good distinct edge that the software could use to recognize the boundary. What I had to do was to fill the inside of the hole with black paint and then paint the outside with white paint. It really wasn’t a problem initially with my first camera because it had fairly low resolution and the image from the camera just seemed to work as-is. But when the LED on it failed and I bought a newer one with higher resolution, it started to see the details of the wood grain and the software had difficulty getting a good fix on the hole itself. I think, as you said, if you make a pattern with drilled holes, you will likely have to do some work to get the camera to be able to accurate detect the boundaries of the hole.

were you using a vision library with object detection (such as opencv)?

David Lang

Yes. The process was adapted from the procedures used for this tutorial.

What about using a sheet of readily available and affordable pegboard which was has a precision machined grid on it already?

There are some good videos on YouTube showing people using this as an indexed jig to make 20mm precision dog hole worktop with a router bit.

Jeff

1 Like

I’ve found there’s enough variation within the board itself with what you find at the big box stores that it won’t work very well… that and that holes are really hard to recognize well…

I’ve started working on a more robust version that uses a custom library of ArUco codes.

4 Likes

I’ve been further thinking about calibration and I know the concept of a mouse sensor has been discussed before, but perhaps it might actually work if we re-home it throughout the calibration process. As an example, the user prints out a grid pattern on standard sized paper (whatever is standard for printers in your neck of the woods) and tapes it to the spoil board aligned as close to the center as they can, though its not actually critical.

Then, using mouse sensor placed at the center of the sled, the sled moves around in some pattern over the paper to calibrate the camera. If you have access to the mouse’s camera image, you can do optical recognition to determine where the camera is on the paper… if not, maybe you need a second camera as well. But knowing the dimensions of the pattern, if you know the mouse is over a particular spot, you can then calibrate the x,y values reported by the camera to actual x,y distances from the center.

Then, you proceed to move around the entire board in something like a looping / flower petal pattern, always returning to the paper pattern to re-home position and eliminate the cumulative error that a mouse sensor develops over time. With all the data points of mouse x,y vs. chain lengths, you can then develop a calibration model for the system.

If it works, it eliminates the 4-foot x 8-foot pattern that optical calibration currently uses.

2 Likes

Wow, that is a really interesting suggestion @madgrizzle. Took me a moment of reflection to fully see what you are proposing but it seems to make logical sense. Essentially it’s a low tech method but with lots of data points that, when combined, should enable a high resolution extrapolation of position. More impressively, as long as there is a nice PDF that fits on 8.5x11 / A4 paper and the person who prints it remembers to tell their PDF software NOT to scale, to output 1:1, then it should be easily accessible to home users.

Is there value in looking at the kinds of 1600dpi mouse sensors that are found in high end gaming mice or is there no particular benefit for 1600dpi in this case? I’m off to read up and find myself an answer on that: https://www.howtogeek.com/182702/mouse-dpi-and-polling-rates-explained-do-they-matter-for-gaming/

-Jeff

1 Like

The most important trait of the mouse is low cumulative error. If a high dpi yeilds that, then yes a high dpi mouse would be good. However, I don’t think high resolution (such as 1600 dpi) in itself is needed for the calibration process.

I don’t think there is a reliable source of mouse modules that give you access to the camera images, so I think the “plan” would be to incorporate any generic usb mouse and then add a second camera (usb endocscope, RPi camera or something) that can detect when you are back at home. Either that or some mechanical/electrical solution that detects when you are back at home (i.e., @dlang’s idea about bolt heads, or maybe a magnet behind the spoilboard and you detect on that… who knows).

But an interesting side effect of this approach might be that you could tweak the x and y scales after-the-fact if you do some test cuts and find something is off. If you retain all the data and the calculation of the calibration is based upon an assumption that the calibration pattern is a given width and height, you might be able to correct x and y scales by changing the width or height of assumed calibration pattern dimension and recalculating the calibration. Note the two mights because I’m not sure this would work… just a thought that popped up.

@bar and @dlang my apologies for the location as I’m not quite sure what thread to put this in, because I was thinking about it for the positioning of the motor mount holes on the top beam, but the more I thought about it the more I thought there may be a place for it in the optical calibration toolkit as well so here it is:

In my previous life when we were doing low-scale prototyping and hand assembling some boards, we had mylar stencils laser cut at Polulu. We used a basic Staples hardboard backed clipboard to hold the stencil over the PCB for applying the solder to the board. Pretty standard stuff. The link to the service from Polulu is here: https://www.pololu.com/product/446 (expensive, but hardly the only option, and at scale should be much more reasonable).

It occured to me that perhaps laser cutting a mylar stencils for various mounting hole positions in the top beam, the sled and possibly to have a particular reference pattern that optical calibration (or another type of calibration?) might use that could be relocated around the work area during the calibration process could be an option?

Cut in large scale I suspect this could be done affordably and would be easy to ship in a document envelope. This could go a long way to making sure a home assembly user has highly accurate, re-usable templates to reference for mounting and calibration.

It may also be a way to create a set of accuracy reference patterns related to fixed tests built in to the firmware, to help people report more accurately what they are seeing as results (following on the “accuracy of tape measures is an issue” thread). In this case a combination of laser cutting and precision marking of scales might be an option?

-Jeff

If I understand the idea correctly, the issue I see is with the accuracy of ‘relocating’ the pattern. Even if you ‘overlap’ the pattern such that you align, for instance, the right part of the pattern with the previous left part, there will be an accumulation of some error. The further you go away from the first pattern, the greater the error will build up.

But maybe you are suggesting something different?

Your understanding is correct, as is your concern about relocating it (at least relative to the other identical test cut locations). I hadn’t resolved that issue yet, although I have a feeling there may be a way to do so, I will keep noodling on it.

I have a hunch that a strong (resilient) set of mylar template and some ingenuity can help us go a long way, especially if we can find a way to index them to a known surface for repeatability.

It strikes me that mylar is likely roll cut rather than sheet cut, which means it could be feasible to to have a calibration set cut that is in two pieces, 1) 4" x 96" and 2) 4" x 48". Just whiteboarding here but if you did that you could index them to the corners of a stock sheet (or even a cut down sheet, and adjust for the reduced size in GC as is already done) and then do the calibration from the known locations on those.

I’m thinking have them meet in the top left corner (indexed to the factory edge of the MDF, maybe specify 1/2" or 3/8" MDF to make it easier and more affordable to acquire and move?) and do a set of readings, move the 48" mylar piece to the middle or far side and do another reading, drop the 96" piece to the middle or bottom and read again, then move the 48" back to the left with the 96" still across the bottom and do a final reading. That would remove the need to measure by hand and give your optical sensor shapes (or other markings, doesn’t have to be cut through on the mylar).

I don’t know about the expansion/contraction risk of mylar or an equivalent, but assuming that isn’t an issue, it could roll easily to ship in the kit box. Perhaps in a cut down poster tube to protect it from damage.

Certainly having a known, consistent, laser cut set of references seems like it would go a long way to improving the ease of calibration and this is one way to do it in a light, small, cheap to ship way that can be extended to include optical calibration support (without requiring the user to use it, in the spirit of different price points or expandability).

-Jeff

@madgrizzle My “edit” turned in to practically another post, so tagging you again so you don’t miss it.

If there is a request for a length of material with a highly accurate repeated pattern in one dimension, why not use factory-perforated sheets of whatever?

  • Paper towel rolls
    the couple kinds I just checked have very accurate repeating perforations and stamped patterns
    con: some places in the world don’t have paper towels

  • One-ply institutional toilet paper
    I don’t have this on hand, but it doesn’t stretch or come with spooling dents like fancy toilet paper
    this one might be more globally available

  • Continuous sheet dot matrix printer paper
    This stuff seems to never go out of use, I bet it can be had in any major city
    Cover the perforations with a repeating color pattern for scale
    Can be had in green bar prints to make counting easier
    I have no proof, but I bet the paper sprocket holes have a universal spacing for all markets

1 Like

If there is a request for a length of material with a highly accurate repeated pattern in one dimension, why not use factory-perforated sheets of whatever?

it needs to be something that doesn’t stretch, and is durable enough to run the
sled over it.

  • Paper towel rolls
    the couple kinds I just checked have very accurate repeating perforations and stamped patterns
    con: some places in the world don’t have paper towels

different brands will have different spaceing, and how do you measure it
accurately enough for 8’ to still have sub-mm precision?

how durable is it?

  • One-ply institutional toilet paper
    I don’t have this on hand, but it doesn’t stretch or come with spooling dents like fancy toilet paper
    this one might be more globally available

brand variation and durability

  • Continuous sheet dot matrix printer paper
    This stuff seems to never go out of use, I bet it can be had in any major city
    Cover the perforations with a repeating color pattern for scale
    Can be had in green bar prints to make counting easier
    I have no proof, but I bet the paper sprocket holes have a universal spacing for all markets

I don’t know about this, I don’t see how the imperial 1/2" spacing would work on
metric size sheets (A4)

This could be durable enough.

David Lang

Agree on the paper towels and toilet paper, they were just the first examples that came to mind.

Seems for continuous sheet paper, the choice of sprocket hole distances outside North America are defined in ISO 2784, which is behind a paywall on every site I visit so far. That said, the imperial paper size is still easy to find and easy to ship, and when I encounter NCR paper at airports and the like, they often are imperial even though all the other stuff is A4. If ISO tractor feed paper is truly out there, its spacing can no doubt be accommodated in software.

For durability a higher weight paper can be selected and the perforations can be taped, and there are also paper variations with the tractor holes not on tearoff strips. For higher optical visibility, a strip of black tape can be run down the backside of the tractor perforations. I can imagine the possibilities would greatly multiply if a working dot matrix printer is used to make patterns, but even just blank paper could provide reliable rows of high-contrast dots.

Continuous paper tracks could be very easily aligned over one another with reasonable accuracy by four steady hands, in effect wallpapering the entire 4x8 foot surface with horizontal dot strips.

Millimetre paper 0.75 x 10m ?
image

3 Likes

Grid paper, even in banner form, seems harder to use than continuous feed paper. You’d have to trim off the borders if you want to overlap the sheets, and after trimming it’s not visually easy to evaluate alignment at a distance due to the fineness of the grid. The tractor paper holes are easier to align, and although there might be a hole only every half-inch, the interval is expected to be very precise and serves the distance-measuring purpose with less complexity.

Up to DIN A2 you get the ‘see through’ version, which is far more precise to align then holes, from my perspective. Not sure if that exists in the above mentioned roll (will search). 3 horizontal paths over the sheet (if it exists), aligned in height by eye and horizontal with a laser level, seems for me more solid.

The width -> how many layers, is my concern.
I’m not sure if you get those tractor papers without the perforation to tear the sides off and the sheets apart. I’m by no means an expert, just would expect that the perforation has the chance to introduce an unwanted stretch.
If what you are talking about is the ‘needle printer paper’ i’m dealing with it regularly. Couple of years back it happened that i’ve torn my receipt apart either by separating the pages or taking the sides off. What i see now (in this remote region), it almost comes off by itself. It seemed to turned very thin. For sure there are options for that, admit.

Kind regards, Gero

Edit: i’m having issue with yards tonight. Someone online to help me out?
How wide and long is this transparent one? Wide transparent accurate grid?

Edit2: just ignore me tonight please :man_facepalming:

1 Like

remember you are trying to get sub-mm accuracy, if you are having to manually
align different pieces of paper, you won’t get that.

David Lang

1 Like

@Gero The millimeter paper, even if translucent vellum-like material, would still be more difficult to align IMO. The grid lines, assuming accuracy even over long distances, still have a thickness on each printed line that might vary. The line thickness could vary, for sure it varies if you have heavier printed centimeter boundaries. Vellum print can be abraded or soiled, making it harder to read. I’m most concerned about global sourcing and shipping of metric niche use paper in tubular form. A crease or kink in vellum would make it hard to keep it flat and accurate. I hear your pain about the thin NCR multipart paper, that stuff tears like crazy and the pin feed holes are often just roughly bashed through. It’d need to be normal computer printer paper, or better yet, cardstock.

@dlang If continuous feed paper (AKA tractor/pin/needle feed paper) is used, you don’t need to align many different squares. Just pay out eight sheets from the box of accordion folded paper, lay it flat, and then overlap four more long strips just like it above/below. You’ll get coverage across most of the work area. Heavier weight paper helps but is not necessary. If you want absolute repeatability, then level and tape your top row, then pilot a few same-size holes exactly through the tractor feed and insert a well-fitting pin, dowel or rod into each hole. I bet four nails holding up eight sheets would be fine without gravity reaming tracks holes. Hang the next sheet strip on the same rods sticking out of the lower edge of the top strip. Align it perfectly and gently tack/staple it down. Repeat with more pins, strips on down the work area. After everything is stapled and taped, remove your pins/dowels and put them away until you need them next. If you goof and tear or ream the paper, just get out some more.

1 Like