Visual alignment mod for shapeoko

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

Re: Visual alignment mod for shapeoko

Post by wlanfox » Wed Jan 09, 2013 8:54 pm

Update:

By searching around I have found ways to align the camera and some exciting extra applications for this kind of setup.

1) How to align you camera, I found a technique by using a mirror and aligning your cross-hair on the camera itself. The basic problem is, if you camera is not align the cross-hair will move away from your target as you move your camera up or down. With a miss-align camera the only way you can get the offset to be valid all the time is to always align at the exact same height, other wise you will be off depending on how bad align the camera is. Other way to look at the issue is a misaligned camera will created a right triangle. The camera being point (A) and point (B) is where your cross-hairs will be looking at (or where your misaligned camera is pointing to, on a very precises aligned camera the distance (a) should ideally be 0).

The symptom: Point and angle C , angle A and angle B are constant but as you change distance (b) distance you will also change distance (a) and remember point B is where your cross-hair is; this will move away form your target as (b) changes.. Again ideally point C and point B should be one of the same.

Image

here is the link to that discussion: http://www.cnczone.com/forums/general_m ... ystem.html

2) another fun thing will be to auto align the material and change the gcode as mention above by levlandau2, for example:



3) Scanning a part into gcode... example:

Last edited by wlanfox on Thu Jan 10, 2013 12:17 am, edited 4 times in total.

PsyKo
Posts: 430
Joined: Thu Aug 30, 2012 8:42 pm
Location: France

Re: Visual alignment mod for shapeoko

Post by PsyKo » Wed Jan 09, 2013 9:45 pm

When I saw your mod, the very first thing I was thinking about was 2D (or 2.5D) part scanning. I already had to reproduce a very tiny airsoft replica mechanism. It was a pain to reproduce in CAD software.
I'm thinking about actual algorithm right now. I don't have Mach 3, so I'm not sure I'll be able to test the freeware from tormach.

But I still have a lot of thing to do on the Shapeoko and not enough time :)
Shapeoko #736
Kress 800, Z Axis upgrade, dual Y, 600mm X&Y rails, metal spacers and V Wheels, home switches, 4th axis
Goko - Free CNC Control Software - http://www.shapeoko.com/forum/viewtopic ... 380#p44380

levlandau2
Posts: 187
Joined: Tue Apr 17, 2012 1:52 am
Location: Minneapolis, MN, USA

Re: Visual alignment mod for shapeoko

Post by levlandau2 » Thu Jan 10, 2013 3:22 am

wlanfox,

So were you able to align your camera using this method? Ideally once the camera is aligned it would be centered at all z-heights right?

xpix
Posts: 218
Joined: Thu Sep 06, 2012 6:47 am

Re: Visual alignment mod for shapeoko

Post by xpix » Thu Jan 10, 2013 11:05 am

Hi,

i found this: http://stackoverflow.com/questions/9854 ... n-an-image

This describes how u can find a cross hair in a picture. May we can try this in wlanfox his example as button? As button, first drive to 0,0,0 and detect the crosshair ;)

PsyKo
Posts: 430
Joined: Thu Aug 30, 2012 8:42 pm
Location: France

Re: Visual alignment mod for shapeoko

Post by PsyKo » Thu Jan 10, 2013 12:24 pm

Detecting a line or cross in an image is not too complicated. Especially with solution like OpenCV.
But if the search of the pattern starts at a random location, let's say X axis first, then Y axis, a recognizable pattern should be available all along the Y axis. This way the software know when it reached the correct X axis, without knowing the Y position of the pattern. Exactly like the homing switch. The only difference is that homing switch is usually on the axis itself, reducing the homing to a 1D homing.
Since the pattern is on the table, it will be a 2D homing.
Shapeoko #736
Kress 800, Z Axis upgrade, dual Y, 600mm X&Y rails, metal spacers and V Wheels, home switches, 4th axis
Goko - Free CNC Control Software - http://www.shapeoko.com/forum/viewtopic ... 380#p44380

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

Re: Visual alignment mod for shapeoko

Post by wlanfox » Thu Jan 10, 2013 6:12 pm

levlandau2 wrote:wlanfox,

So were you able to align your camera using this method? Ideally once the camera is aligned it would be centered at all z-heights right?
Yes I have, but still playing with it... not satisfied yet... I want less then 0.05mm drift from a zoom delta of 40mm. Right now I am about 0.8mm - 0.1mm.

The issues so far...

1) Adding washers and making holes wider in one of the clamps to have that kind of adjustment is a pain!!!... now I am thinking of a base that can have fine adjustments that can be locked.

2) The USB microscope have a focus adjustment, you must use your Z axis as your focus control, adjusting the focus with the knob will mess-up your alignment you just work so hard to get right :'(. The phrase "you get what you pay for" comes to mind. Also thinking about taking this things apart and creating a solid non-shifting focus mechanism. Or looking for something already made. Also to keep in mind as you turn your spindle on this will add high vibrations if this focus mechanism is not solid it will shift.

3) With USB microscope having focal point is hard to go too far on your Z axis because you will be out of focus. but even when blurry image everything seems to be aligned.

4) IMPORTANT: Microscope, aligning, mirrors and uneven surfaces... not a good thing. You must have a perpendicular surface against your camera milling a MDF board as it is done for PCBs is not a bad idea that is actually what I am doing next to get even a better alignment.

FYI I am also trying a infinite focus camera non microscope style (no moving parts) Like this one:
http://www.ebay.com/itm/2M-Waterproof-T ... 3a7ce23402

Will report more later.

-wlanfox
Last edited by wlanfox on Fri Jan 11, 2013 2:52 am, edited 1 time in total.

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

Re: Visual alignment mod for shapeoko

Post by wlanfox » Fri Jan 11, 2013 2:49 am

Update: I believe I am there :), I won't mess with it for a while... around 0.1 drift in a delta of 40mm on Z axis, now knowing this I will probably always align around the same height just to be as close as I can.

Looks like:
Image

Aligned:
Image

As close as I can get before spindle hits material:
Image

40mm away from previous position:
Image

PsyKo
Posts: 430
Joined: Thu Aug 30, 2012 8:42 pm
Location: France

Re: Visual alignment mod for shapeoko

Post by PsyKo » Fri Jan 11, 2013 8:33 am

0.1
wlanfox wrote:around 0.1 drift in a delta of 40mm on Z axis

This looks like a good precision. Anyway, I think it's always better to align at the lowest possible Z.

Do you have any recommendation on the design of the camera holder ? If attached to the makerslide, with 2 copies of the same holder, it should be pretty parallel ? Is this due to innacuracy while machining the holder ?
Shapeoko #736
Kress 800, Z Axis upgrade, dual Y, 600mm X&Y rails, metal spacers and V Wheels, home switches, 4th axis
Goko - Free CNC Control Software - http://www.shapeoko.com/forum/viewtopic ... 380#p44380

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Visual alignment mod for shapeoko

Post by Will Winder » Fri Jan 11, 2013 2:54 pm

How has Universal Gcode Sender been treating you?
I'm planning to revisit the jogging functionality soon, are there any features or improvements you would like to see? Or other things that would make your life easier?
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

PsyKo
Posts: 430
Joined: Thu Aug 30, 2012 8:42 pm
Location: France

Re: Visual alignment mod for shapeoko

Post by PsyKo » Fri Jan 11, 2013 3:02 pm

Will Winder wrote:How has Universal Gcode Sender been treating you?
I'm planning to revisit the jogging functionality soon, are there any features or improvements you would like to see? Or other things that would make your life easier?
I have one recommendation (I think this should be a completely new topic). For some reason, I always have to restart my UGCS after finishing a job. This resets my zero position.
I already updated to last version of UGCS. I will update to last version of GRBL soon.

Any idea ?
Thanks
Shapeoko #736
Kress 800, Z Axis upgrade, dual Y, 600mm X&Y rails, metal spacers and V Wheels, home switches, 4th axis
Goko - Free CNC Control Software - http://www.shapeoko.com/forum/viewtopic ... 380#p44380

Post Reply