DIY CNC Scanner Application Notes

July 30, 2010 by: Andrew Grevstad

The share­ware ver­sion of CNC Scan­CAD has cre­ated a lot of inter­est in play­ing around with our new CNC Scan­ner soft­ware (as well as the arti­cle in Dig­i­tal Machin­ist). This is very cool, and its been a fun week talk­ing with peo­ple who’ve been try­ing it out. The avail­abil­ity of low cost cam­eras makes scan­ning pretty easy to do, but we do want peo­ple to be aware of the rela­tion­ship between cam­era qual­ity and scan quality.

If you buy CNC Scan­ner from us, you’ll be get­ting our cus­tom designed mount, one of the bet­ter cam­eras from Dino-Lite, fully func­tional soft­ware, and sup­port direct from Tor­mach. As for the Dino-Lite cam­eras, these are Tai­wanese made cam­eras, but there are numer­ous knock-offs made in China. Unfor­tu­nately, none of the knock­off designs are made to the same qual­ity. They do, how­ever, gen­er­ally all share the same style and size hous­ing, which means that the major­ity will work very well with the holder that we have.

We tried a lot of dif­fer­ent lower cost cam­eras from a vari­ety of ven­dors and found some pretty sig­nif­i­cant lim­i­ta­tions with many of the mod­els, which is why we set­tled on the cam­era mod­els we offer. If you do want to play with CNC Scan­ner using a cheap cam­era, you should rec­og­nize these lim­i­ta­tions. There are a lot of para­me­ters in optics and USB micro­scopes. I won’t get into them all, but rather the most impor­tant para­me­ters we found. These are lens qual­ity, lens align­ment, reten­tion of focus, and illumination.

Lens Qual­ity and Lens Align­ment
Really cheap cam­eras, such as those you see for $25 on Ebay (search USB Micro­scope) do work, but we found they are not with­out sig­inif­i­cant per­for­mance com­pro­mises. Basic lens qual­ity and lens align­ment can be tested by focus­ing 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 some­thing else that is suit­ably flat. To prop­erly eval­u­ate mag­ni­fi­ca­tion we use a square con­tact retic­ule like this one: Edmund NT39-463.

The image should be clear with a con­sis­tent focus across the full field of view. The lines on the result­ing dig­i­tal image should be absolutely straight, par­tic­u­larly on the edges. Most of the cheap cam­eras we tried had lens align­ment issues that would allow us to focus in one point over the field of view, but a per­fect focus over the full field of view was not depend­able. You might get one that works, but we would pur­chase bunches of cam­eras and test sev­eral. Some­times there was a good one, but in the cheap cam­eras we found it was a crap shoot and lots of them were bad.

.

Reten­tion of Focus
The other issue is the abil­ity to retain focus. The cheap cam­eras hold focus using heavy grease. As the LED illu­mi­na­tors warmed up the cam­era body, the grease would get soft and the lens would move. You can see this with a large area scan, where the begin­ning of the scan is clear but the cam­era drifts out of focus as the scan con­tin­ues. Bet­ter qual­ity scopes do not have this prob­lem to the same severity.

Illu­mi­na­tion
Some very basic scopes have illu­mi­na­tion issues, espe­cially if the scope needs to be posi­tioned close to the sur­face of the work to achieve the fea­ture res­o­lu­tion you want. Gen­er­ally speak­ing, the more illu­mi­na­tion con­trol set­tings, the bet­ter off you will be as these can be adjusted to pro­vide the best poss­bile image. Oth­er­wise, the image can be either so poorly illu­mi­nated that you can­not dis­tin­guish feau­tures or so brightly illu­mi­nated that the fea­tures are washed out.

.

We encour­age you to con­tinue exper­i­ment­ing with the soft­ware. We just wanted to make you aware of the rela­tion­ship between hard­ware and soft­ware. And please do send me a note if you have feed­back or other ques­tions about CNC Scanner.

VN:F [1.9.22_1171]
Rat­ing: 0.0/10 (0 votes cast)
Be Socia­ble, Share!
Andrew Grevstad

About

With over ten years of pro­fes­sional expe­ri­ence in advanced man­u­fac­tur­ing sys­tems, dig­i­tal design tools, and applied soft­ware, Andy Grevs­tad has worked in prod­uct devel­op­ment and tech­ni­cal sup­port for Tor­mach since 2008. Grevs­tad has received engi­neer­ing degrees from Michi­gan Tech­no­log­i­cal Uni­ver­sity and a M.S. and Uni­ver­sity of Wisconsin-Madison. He is a reg­u­lar con­trib­u­tor to Dig­i­tal Machin­ist mag­a­zine and also blogs weekly about CNC milling and related top­ics on the Tor­mach blog, Milling Around.

7 Responses to “DIY CNC Scanner Application Notes”

  1. Roy says:

    This soft­ware is very cool, but..

    I con­stantly get an error with my cheap cam on the scale-by-motion screen. The error “Dis­tance between cam­era 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 suc­cess­ful (ran­domly I think), the scans have been pretty good for a $9 cam­era bolted to a stick of 3/4″ rod.

    Also, is the unreg­is­tered Scan­CAD soft­ware sup­posed to do edge-detection on it’s own? All I’ve been able to do is draw fea­tures on the image and mea­sure those.

    Thanks

  2. Andrew Grevstad Andy G. says:

    Tech­ni­cally, this means that the min­i­mum length res­o­lu­tion you are try­ing to achieve (i.e., the small­est fea­ture that you can visu­ally dis­tin­guish) is less than the width of one pixel. There are at least three ways to try to rem­edy this, and you may need to do a com­bi­na­tion of all three:

    1. Reduce the work­ing dis­tance between the cam­era and the object you are scan­ning. For very detailed scans, I’ve posi­tioned a cam­era as close as 0.050” above the sur­face.
    2. Increase the desired res­o­lu­tion in the setup. The default is 0.003”. You may need to increase to .010” or larger.
    3. Use a higher res­o­lu­tion cam­era. This effec­tively gives you more pix­els over the same area.

    No Edge Detec­tion is avail­able for the soft­ware cur­rently. I’m hope­ful this can be part of an upcom­ing release.

    Andy

  3. One of the most impor­tant things is a cam­era that is cen­tered prop­erly. If not you’ll run into a shift tilt focus­ing issue.

    A few other things I wanted to add is on the less exspen­sive style cam­eras you’ll find cheap optics, mostly macro type close up lenses (very bad qual­ity). On the less expen­sive brands you’ll also run into prob­lems like Chro­matic aber­ra­tions and bar­rel dis­tor­tion just to name a few. Chro­matic aber­ra­tion causes pur­ple fring­ing in your image, mak­ing it very hard to pin point a loca­tion, line, etc… Bar­rel, Pin­cush­ion dis­tor­tion depend­ing on what optic is used can cause soft edges, dis­torted pic­ture qual­ity bend­ing the image inward or outward.

    I haven’t had a chance to check a new Tor­mach CNC scan­ner yet, but I’m sure the prod­uct is worth every penny.

    Keep up the great work guys !!!

  4. Kent Myers says:

    I also was get­ting the “Dis­tance between cam­era and machine is too great” error. I found you really need to have the scope close to the work­piece avoid it.

    If you’re look­ing for fea­tures for the next release, being able to cre­ate cir­cles from three points would be nice. You can cre­ate arcs from three points now, but cir­cles would be nicer for locat­ing holes in a part.

  5. Andrew Grevstad Andy G. says:

    Try using the Cir­cle -> 3p com­mand. I thought this was in the man­ual, but it isn’t! Undoc­u­mented fea­ture at this point until a man­ual update. There is also Circle->2p, which is a cir­cle by 2 points. Just enter “3p” or “2p” in the com­mand line after choos­ing the cir­cle tool.

    Andy

  6. Roy says:

    Thanks Andy. That expla­na­tion of the error makes some sense. I was test­ing with a very basic web­cam– no micro­scope fea­ture, so get­ting it any closer and hav­ing it focus is a no-go, but I’ll try the other set­tings. I’ve noticed that light­ing is crit­i­cal 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 cir­cle… some­thing that doesn’t involve the com­mand line any­way. Handy tool.

  7. Rockon says:

    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.