DIY Comparatron Helps Trace Tiny, Complex Objects

Hackers frequently find themselves reverse-engineering or interfacing to existing hardware and devices, and when that interface needs to be a physical one, it really pays to be able to take accurate measurements.

This is easy to do when an object is big enough to fit inside calipers, or at least straight enough to be laid against a ruler. But what does one do when things are complex shapes, or especially small? That’s where [Cameron]’s DIY digital optical comparator comes in, and unlike commercial units it’s entirely within the reach (and budget) of a clever hacker.

The Comparatron is based off a CNC pen plotter, but instead of a pen, it has a USB microscope attached with the help of a 3D-printed fixture. Serving as a background is an LED-illuminated panel, the kind useful for tracing. The physical build instructions are here, but the image should give most mechanically-minded folks a pretty clear idea of how it fits together.

So how does it work? One places the object to be measured onto the illuminated bed, and the software shows a live microscope view, with a tiny cross-hair in the middle of the video. By jogging the microscope around — which the platform is capable of doing in increments as small as 0.1 mm — one can visually mark a series of points on the object, creating a sort of point cloud.

Because the distances between these points are recorded by physically moving the microscope in known, real-world amounts, the resulting “point cloud” accurately reflects real-world points on the actual object. From there, one simply exports as a DXF, then imports into the CAD software of one’s choice. The last step is essentially connecting the dots. It requires some patience from the operator, but it’s highly accurate, and the price is certainly right.

The popularity of 3D printers has helped make CNC hardware cheaply accessible to hobbyists, and their precision makes them attractive foundations for projects that measure small distances. You can see [Cameron]’s Comparatron in action in the video below.

21 thoughts on “DIY Comparatron Helps Trace Tiny, Complex Objects

    1. But what sort of dxf. It seems every program that can export them exports a slightly diferent type of dxf, and every program which imports them (particularly laser cutting software) only seems to recognise a subset of all the possble different dxf “standards” that various programs export.

  1. I’d rather buy LPL’s Genesis Set and just pick the lock. Most locks are picked within few minutes so it’s cheaper than buying microscope, rails and sedes motors.

        1. I don’t think that there is any issue with aperture distortion. In the video it is clear that there are discrete measurements being made at the same sight line through the lens for each measurement (the little dot). If there was image capture over the field, I’d agree with you.

        2. The accuracy here is only limited to the steps of his gantry axes. That being said, unless he can magnify, and be more granular than a flat bed scanner, I think I would find the former more expedient. B/W high contrast scan, apply edge detection, subtract interior, limit adjacent matching color pixels to two on your line color, and no fiddling around with placing points. Of course that only works with more or less flat surfaces. The screw he’s scanning on the project page would be more accurate on his setup, or imaged from a very long focused camera.

        3. Distortion will never matter for a point in the centre of the camera’s field of view. By moving the camera to kep the centre on the points of interest, rather than finding those points within a static image you avoid all lens distortion effects. A light ray going in to the middle of your optics always just goes straight through.

  2. Increments as small as 0.1mm ? Isn’t that a bit big for “tiny objects”?

    That said, the idea seems sound enough. Folk have been using probes on CNC machines to digitise shapes for a while, and using cameras to align to features. This is just putting the two together.

    Here is a video of the former, I think it is worth posting here because the G-code that traces the outline is in the description. (it’s a “keep turning right” algorithm)

    1. I doubt it would copy a laser cut car key.

      Looks to be built on a laser cutter frame with belt drive. Going to need a restart to get better.

      Not supposed to be a CMM, rather a scanner for 3d printing, so no point being more accurate.

  3. Nice. The expensive ones probably are telecentric, so they can accurately measure across most (or all) of the visual field with minimal focus adjustment.

    Hmmm… pick up a low cost (~100 used, MML2-ST65D) 2x telecentric. Add to a PI HQ camera (kings ransom time). You’d only get a visual field of about 4mm diagonal, but you’d get theoretical resolution of 5.8um (~0.75um for pixel pitch, but the optic spec says 5.8) across the face with no parallax. A little machine vision and machine control could step across the entire field and rapidly capture and reconstruct an accurate scan of an object. Depth of field of 0.35mm and a working distance of 65mm for the mentioned part.

    I wonder if that would be more a step forward or backward for this setup.

  4. I wonder how accurate/precise 3D printer motion axes are – would one of those parts-only Enders on eBay be a usable starting point? I suspect not if you needed high precision, but maybe good enough for basic home-shop usage(?)

    Basic leadscrew actuators are still pretty cheap, and would probably be good to +/- 0.05-0.02 mm over short distances, provided you made sure you were always measuring coming from the same direction to avoid backlash.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.