Calibration Process Brainstorming, Part Deux

I figure 1/2 would be more stable, but could be 1/4 inch

True… and if I can calculate the tilt of the sled by the tilt of the square I’m measuring, I could calculate the error.

1 Like

I was thinking the same thing @Bee

1 Like

@madgrizzle

If you work with the offset permanent camera we could also use it to catalog and record unused sections of plywood in GC for recall and pattern maximization.

Thinking long term uses beyond calibration.

Thank you

1 Like

A little more thinking on this. My original process was to align the camera with the router bit and when the user “calibrates” the camera, it calculates the difference between center (0,0) and the graphic pattern. This way, the machine knows just how far off origin the center actually is (I doubt many people’s machines end up precisely at the center point of the 4x8 ply after they calibrate). With the offset camera, this might be accomplished one of two ways (and I’m not completely sure).

First, if you accurately measure exactly where the camera is located with respect to the router bit (i.e., distance and angle or x,y and camera pan/tilt values) then you could use the picture the camera takes of the calibrating graphic pattern to determine the offset. However, I’m not sure this would account for the rotation of the sled. If the sled is rotated 2 degree CW and it’s not taken into account during the calculations, I suspect there will be an error in determining the calibration error… I suspect, I don’t know

Second, you could require the user to precisely place the router bit at the center of the calibration graphic pattern. Perhaps use a v-bit so it precisely aligns with a dot in the middle of the center square. The software can then use the captured image to determine where the camera is (distance, angle, pan/tilt). Here, I think a rotation of the sled would throw things off because the software might assume the camera was slightly rotated. I’m not sure we can tell the difference without something measuring the tilt of the sled/router…

Drawing2

Of course, with the offset camera, the math becomes significantly more complex and therefore would take significantly more time to figure out how to do it.

1 Like

Sooooo… once again @dlang has a potentially good idea. There are optical mouse modules available that interface to arduinos, though I would likely consider a separate arduino for this and not try to use the motor control arduino at same time. If one is placed at the router bit (and worked well to detect movement), you wouldn’t need a pattern as @dlang says. However, one thing I don’t know is if the rotation of a mouse sensor about its optical sensor’s axis results in some kind of x,y movement calculation. It would require a precise mount to be built, but I don’t think that would be all that hard.

As an alternative (i.e., rotation is a problem) I was wondering if two sensors could be used (one at top of sled, one at bottom) and the difference in movement would be able to be used to calculate how much the sled has rotated. However, I think the accuracy of this calculation would depend upon the accuracy how well the optical sensors could be aligned. You would almost want to laser cut a metal mount (hey @dlang) that you could install in a dado on the bottom of the sled. See below.

Alternatively, I was wondering if you used three sensors, could you use mathematics to determine the position of the sensors based upon movement of the sled. That is, I hypothesize that for a given set of measurements during a move, only one geometry of sensors would result in that data and you could calculate their positions from that data. This eliminates concern over alignment of the sensors… thoughts?

Drawing3

1 Like

Not sure if this is useful, but will post it just in case. I was searching for robot positioning with optical mouse and found this pdf.


https://www.researchgate.net/publication/221645389_Dead_Reckoning_for_Mobile_Robots_Using_Two_Optical_Mice

2 Likes

Thanks… that seems to confirm some of my suspicions. I guess D is known in the diagram. I wonder if there is a solution for three mice. I’m trying to eliminate any need to critically align/install parts. Will look.

1 Like

Might something like this serve as a calibration background?

39 x 59 inch polyethylene cutting mat with 1" grid marking.

https://quilting-warehouse.com/collections/quilt-tools-rotary-cutting-mats/products/sullivans-home-hobby-cutting-mat-36inx59in

1 Like

For the routines that I have, I’d have to invert the picture and calculate the white space as squares. The problem is that when there are more than one square the camera can see, it will be hard to tell which is the correct one. With squares that close, I will likely see multiple squares. That’s why I was looking for a pattern of regularly spaced squares so that only one square is visible at a time.

1 Like

I read the paper @gero and it looks like for 80 meters of travel, positional error was 114 mm (0.001425%). So positional error from the center to a corner of a standard sheet of plywood (1363 mm diagonally) could be about 2mm, which unfortunately is not very good (great for robotics, not CNC) Thanks for finding that.

1 Like

What I’m now considering doing is opening up my endoscope casing and looking to see if I can desolder the cable and resolder it at a different orientation. Here’s a picture of a endoscope module you can get online and changing the cable orientation seems readily doable. This would allow you to insert the end of the module up into the router body and greatly simply the mount (basically, it becomes a collet)

4 Likes

Can you turn a pencil insert adjusted for the endoscope diameter?

If you are referring to a big chunk of wood (like what someone posted somewhere), no, I don’t have a lathe to do a turning. And to find something with 3&5/8 inch diameter already done isn’t likely.

I’m afraid I’m reaching analysis paralysis…I’m looking at endoscope modules off AliExpress… long shipping but it’s not glued into a tube already. They also have a module with the camera flat on the PCB (90 degree from how most endoscopes are)… so you could attach it to a 1/2 rod with some strong glue and call it a day.

1 Like

Could you just use computer vision to measure a qr code to calculate pixel change to distance?

1 Like

There a number of possible ways and a QR code would work. Originally, I was looking at AR registration codes but the software for it isn’t readily available for Python. Then I found someone that was able to calculate x&y distance to the center of a geometric shape with OpenCV and Python and that’s what I’ve been working with.

AR registration codes and software would work well with a camera that was offset from the router bit since it was designed to handle 3D perspective, but the libraries that make it easy to do use C++ and not Python and I’m not trying to make my life much more complicated than it is… and we would still need to deal with the sled rotation issue I discussed above.

1 Like

@Bee, I think my new solution is much more amiable to a 3D printer. I purchased a camera module off of aliexpress that I’m hoping will work. The camera is separate from the PCB so it could easily attach to a 1/2-inch router camera mount.

Do you think a 3D printer could produce something like this (roughly drawn) with accuracy such that placing the camera in the mount, it would pretty much be dead-center?

camera%20mount-1

2 Likes

Yes this is perfect for a 3D printer to make. What program is it designed in Fusion 360? What 3D Printer are you looking at?

Thank you

I did it in SketchUp buy it’s not 100% accurate since I don’t have the camera module yet (shipping takes long time). Need to measure the dimensions… this is just approximate. I was looking at the cheap monoprice printer.

@Bee, would you recommend PLA or ABS for such a mount? I’m just learning this stuff…

1 Like