DIY CNC Scanner Application Notes

The shareware version of CNC ScanCAD has created a lot of interest in playing around with our new CNC Scanner software (as well as the article in Digital Machinist). This is very cool, and its been a fun week talking with people who’ve been trying it out. The availability of low cost cameras makes scanning pretty easy to do, but we do want people to be aware of the relationship between camera quality and scan quality.

If you buy CNC Scanner from us, you’ll be getting our custom designed mount, one of the better cameras from Dino-Lite, fully functional software, and support direct from Tormach. As for the Dino-Lite cameras, these are Taiwanese made cameras, but there are numerous knock-offs made in China. Unfortunately, none of the knockoff designs are made to the same quality. They do, however, generally all share the same style and size housing, which means that the majority will work very well with the holder that we have.

We tried a lot of different lower cost cameras from a variety of vendors and found some pretty significant limitations with many of the models, which is why we settled on the camera models we offer. If you do want to play with CNC Scanner using a cheap camera, you should recognize these limitations. There are a lot of parameters in optics and USB microscopes. I won’t get into them all, but rather the most important parameters we found. These are lens quality, lens alignment, retention of focus, and illumination.

Lens Quality and Lens Alignment
Really cheap cameras, such as those you see for $25 on Ebay (search USB Microscope) do work, but we found they are not without siginificant performance compromises. Basic lens quality and lens alignment can be tested by focusing on a bit of graph paper. If you just want to get an idea of what this is about, you can get some very fine graph paper and afix it to a piece of plate glass or something else that is suitably flat. To properly evaluate magnification we use a square contact reticule like this one: Edmund NT39-463.

The image should be clear with a consistent focus across the full field of view. The lines on the resulting digital image should be absolutely straight, particularly on the edges. Most of the cheap cameras we tried had lens alignment issues that would allow us to focus in one point over the field of view, but a perfect focus over the full field of view was not dependable. You might get one that works, but we would purchase bunches of cameras and test several. Sometimes there was a good one, but in the cheap cameras we found it was a crap shoot and lots of them were bad.


Retention of Focus
The other issue is the ability to retain focus. The cheap cameras hold focus using heavy grease. As the LED illuminators warmed up the camera body, the grease would get soft and the lens would move. You can see this with a large area scan, where the beginning of the scan is clear but the camera drifts out of focus as the scan continues. Better quality scopes do not have this problem to the same severity.

Some very basic scopes have illumination issues, especially if the scope needs to be positioned close to the surface of the work to achieve the feature resolution you want. Generally speaking, the more illumination control settings, the better off you will be as these can be adjusted to provide the best possbile image. Otherwise, the image can be either so poorly illuminated that you cannot distinguish feautures or so brightly illuminated that the features are washed out.


We encourage you to continue experimenting with the software. We just wanted to make you aware of the relationship between hardware and software. And please do send me a note if you have feedback or other questions about CNC Scanner.

Andrew Grevstad


With over ten years of professional experience in advanced manufacturing systems, digital design tools, and applied software, Andy Grevstad has worked in product development and technical support for Tormach since 2008. Grevstad has received engineering degrees from Michigan Technological University and the University of Wisconsin-Madison. He is a regular contributor to Digital Machinist magazine and also blogs weekly about CNC milling and related topics on the Tormach blog, Milling Around.

7 thoughts on “DIY CNC Scanner Application Notes

  1. This software is very cool, but..

    I constantly get an error with my cheap cam on the scale-by-motion screen. The error “Distance between camera and machine is too great!” comes up all the time.

    WTF does that mean and what’s the best way to get past it? The few times I’ve been successful (randomly I think), the scans have been pretty good for a $9 camera bolted to a stick of 3/4″ rod.

    Also, is the unregistered ScanCAD software supposed to do edge-detection on it’s own? All I’ve been able to do is draw features on the image and measure those.


  2. Technically, this means that the minimum length resolution you are trying to achieve (i.e., the smallest feature that you can visually distinguish) is less than the width of one pixel. There are at least three ways to try to remedy this, and you may need to do a combination of all three:

    1. Reduce the working distance between the camera and the object you are scanning. For very detailed scans, I’ve positioned a camera as close as 0.050” above the surface.
    2. Increase the desired resolution in the setup. The default is 0.003”. You may need to increase to .010” or larger.
    3. Use a higher resolution camera. This effectively gives you more pixels over the same area.

    No Edge Detection is available for the software currently. I’m hopeful this can be part of an upcoming release.


  3. One of the most important things is a camera that is centered properly. If not you’ll run into a shift tilt focusing issue.

    A few other things I wanted to add is on the less exspensive style cameras you’ll find cheap optics, mostly macro type close up lenses (very bad quality). On the less expensive brands you’ll also run into problems like Chromatic aberrations and barrel distortion just to name a few. Chromatic aberration causes purple fringing in your image, making it very hard to pin point a location, line, etc… Barrel, Pincushion distortion depending on what optic is used can cause soft edges, distorted picture quality bending the image inward or outward.

    I haven’t had a chance to check a new Tormach CNC scanner yet, but I’m sure the product is worth every penny.

    Keep up the great work guys !!!

  4. I also was getting the “Distance between camera and machine is too great” error. I found you really need to have the scope close to the workpiece avoid it.

    If you’re looking for features for the next release, being able to create circles from three points would be nice. You can create arcs from three points now, but circles would be nicer for locating holes in a part.

  5. Try using the Circle -> 3p command. I thought this was in the manual, but it isn’t! Undocumented feature at this point until a manual update. There is also Circle->2p, which is a circle by 2 points. Just enter “3p” or “2p” in the command line after choosing the circle tool.


  6. Thanks Andy. That explanation of the error makes some sense. I was testing with a very basic webcam– no microscope feature, so getting it any closer and having it focus is a no-go, but I’ll try the other settings. I’ve noticed that lighting is critical to get a clean scan as well since my cam has no lights either.

    I think I’ve used the 3-points arc with a 360′ arc to make a circle… something that doesn’t involve the command line anyway. Handy tool.

  7. I think I’ve used the 3-points arc with a 360′ arc to make a cir­cle… some­thing that doesn’t involve the com­mand line any­way. Handy tool.