Wednesday, 15 February 2023

Cartesian bots & imaging ideas

So one sort of project that I think about a fair bit, and do far less actual doing of, can be thought of as imaging with a cartesian robot.  Think of your common garden-variety 3d printer.  Now replace the plastic-squirting bits with a camera, and you've got the basic idea.

(OK, most 3d printers cheat a bit by moving the bed for the y axis, which isn't necessarily ideal, but close enough.  Now stick something you want to scan on your bed, say a PCB.  Take a whole bunch of pictures at known x/y coordinates, on a grid, do a bit of dewarping and stitching together, and bing bang bong, you've got an extremely high resolution image of your PCB.  

Further refinements: Have a ring of addressable RGB LEDs around the camera, so we can take pictures with different lighting.  Include UV LEDs and we can also catch florescence.  Add a magnometer, inductive sensor, check for capacitive coupling...

On a different tack, refine by being smart about where you take your next photo -- train an AI, or keep a level-of-detail for each image, and take an image halfway between the "sharpest" pair of neighboring images.  Should produce more useful images in shorter time then just scanning the whole grid.

Third idea, give it some sort of grippy thing.  Run k-means (or another clustering algorythm) on the images, determine your k clusters.  One of them will be "empty space".  Take the other k-1, find the best exemplar of that group (the one in the middle of the cluster).  Attempt to pick it up -- for example, increase the strength of your electromagnet until the load cell value changes, meaning you've picked something up -- move over to the largest (physical) cluster of empty space, and set your electromagnet back to zero.  Now take another photo of the region you dropped on, forcably add it to the cluster you assigned it earlier, and repeat.  (The last step *should* help with making the clusters be more orientation-independent -- that is, properties of the object that don't change when it's laying on the bed in a somewhat different position.)

If that last one worked correctly, you now have a robot that will sort your nuts from your bolts, your big bolts from your little bolts, or whatever else you care to throw at it.