By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Forum House Ad Zone

Backlash

Sanity check

All Topics | Latest Posts

Search for:  in Thread Title in  
SillyOldDuffer21/04/2019 13:18:08
10668 forum posts
2415 photos
Posted by Charles Shearer 1 on 21/04/2019 11:53:55:

Hi John,

Oh no! I feel project creep kicking in here. If I understand you correctly I need to physically add said encoder to the linear rail?

Much as I'd like to declare version 1.0 - this intrigues me, I'll have to look into this.

Can they actually have the resolution to detect the microstep sizes I'm using?

Any further detail appreciated.

Thanks

Charles

Charles probably doesn't need to worry about absolute position. He's frame stacking on focus to increase depth of field rather than to improve signal-to-noise as the astronomers do.

Given an object like the head of a wasp, I guess Charles would start by focussing a highly magnifying camera lens on the very front of the insects head. As the camera is only in focus in that particular plane, most of the head will be more-or-less blurred, not a good photo. Moving the camera to focus on the middle part produces another image, again mostly blurred but now with the central plane in sharp focus. Repeating after moving the camera to focus on the rear of the head, and you get 3 mostly blurred photos, each of which is good at one point. Focus stacking creates a new picture by combining the in-focus parts of the three duds, essentially by ignoring anything in each image that's blurred.

Charles hasn't said what his lens is, but no doubt it's far more tightly focussed than would allow a good photo to be captured from only 3 images, hence he proposes to take 2 or 3 hundred. Provided he has a reasonably spaced sequence of images it should work without any need for CNC-level precision or accuracy. I don't think focus stacking needs to know how far the camera is moved, nor is it critical to move the camera exactly the same distance each time. A few missed steps resulting in duplicate images are unlikely to make much difference. The software cares little what the distance between frames actually is; whatever image it gets, blur is suppressed and focus retained.

What might cause trouble is moving the camera backwards and forwards during a run. As moving the camera along the rail alters the apparent size of the subject the focus stacking software likely compensates by resizing frames on the assumption camera movement is linear. Either forwards or backwards, but never a mixture.

The number of steps needed to get a good composite is related to the depth of focus of the lens. Too few steps and the composite will be inferior to the best possible, too many steps wastes time because adjacent photos don't differ enough in focus to matter, and they increase the risk of unwanted artefacts appearing due to computer processing.

Dave

Michael Gilligan21/04/2019 13:57:44
avatar
23121 forum posts
1360 photos
Posted by SillyOldDuffer on 21/04/2019 13:18:08:
.
I don't think focus stacking needs to know how far the camera is moved ... The software cares little what the distance between frames actually is ...

.

I can confirm that, Dave "from the horse's mouth"

Rik Littlefield [the author of Zerene Stacker] told me it was so.

MichaelG.

.

[quote]

On 14 Jul 2018, at 01:45, [email protected] wrote:
 
Michael,

I do not anticipate any special problems from either the unequal spacing or the small number of frames.  Unless you're doing synthetic stereo (probably not practical with only 3 images), Zerene Stacker does not make any assumptions about equal spacing.  And while 3 frames is definitely on the short end of things, I have seen even 2-image stacks processed to good effect.

[/quote]

Edited By Michael Gilligan on 21/04/2019 14:02:22

Charles Shearer 121/04/2019 15:02:28
9 forum posts
3 photos

Hi,

It's being tested as we speak after some final tweaks to the code (until v 1.1). From a couple of runs so far - bearing in mind my DTI's have divisions of 0.01 mm (which I believe is pretty cheap and cheerful) - I can see slight errors now.

The microcontroller is still unboxed (3dPrint project next) so it looks untidy) - but photos will be nevertheless be forthcoming asap.

Best

Charles

Round 2 testing:

1) Full steps i.e. 0.005mm out 2000 steps DTI 10.00 mm Back 2000 steps DTI 0.00

2) Half steps i.e. 0.0025mm out 4000 steps DTI 10.015mm Back 4000 steps DTI 0.015 mm

3) Quarter steps i.e. 0.00125mm out 8000 steps DTI 10.015 mm Back 8000 steps DTI 0.015 mm

4) Eighth steps i.e. 0.000625mm out 16000 steps DTI 10.015mm Back 8000 steps DTI 0.045mm ???? Re-test

5) Sixteenth steps i.e. 0.0003125 out 32000 steps DTI 10.015mm Back 32000 steps DTI 0.05 ?? Re-test

As you say the processing software doesn't care about where the the plane of focus was - just extracts the sharpest detail from each image in the stack - but, the important point is that if you miss a plane of focus you spoil the overall image by having even a tiny element out of focus. As an example, at a modest magnification i.e. 5:1 the depth of field i.e. the depth of the plane of focus at, f2,8 on a full frame sensor, is a mere 0.0030mm deep (reduced by 20% to allow for image overlap). So it is important that there are steps between shutters of no more than that amount .

Update - I know why the 1/8th and 1/16 are out - mathematical precision of the microcontroller - fixing it!

Charles

Neil Wyatt21/04/2019 15:50:46
avatar
19226 forum posts
749 photos
86 articles
Posted by Charles Shearer 1 on 20/04/2019 22:59:01:

Michael,

Understood.

You are of course correct that there is no absolute necessity to find the exact IN and OUT points - but when at 20x magnification even being slightly out can result in many wasted shutter actuations - and wasted images!

With some runs in the hundreds of images for stacking and a touch of OCD I'm just seeking to make things as accurate and as automated as I can within the mechanical limitations of the linear rails / stepper.

Thanks again

Charles

The simple answer is always finish every move by taking up the backlash in the same direction, so set a minimum additional move for reversals of Y= backlash plus a safety margin.

Set the 'base position' by moving forards Y steps.

Now if you move forward X, just move X steps.

If you move backwards X steps, move X + Y, move forwards Y.

This is how GOTO telescopes compensate for backlash, although they tend to use rather pessemistic (large) values for 'Y'

Neil

Charles Shearer 121/04/2019 17:05:42
9 forum posts
3 photos

platform.jpgFinished tweaking code and recalibrated stepsizes / backlash after higher precision calculations after switch to Arduino DUE. Now getting < than 0.05 backlash across all microsteps in 10mm travel.

Happy to work with this until I find that absolute encoder !

Couple of pics - lazy - just used compact camera so poor in quality. One of the controller screens and the linear platform.

Thanks to all for suggestions

Best Charlescontroller.jpg

Ian P21/04/2019 20:21:39
avatar
2747 forum posts
123 photos

Regarding the 'encoder'.

Rotary encoders with several thousand PPR (pulses per revolution) will give you the leadscrew angular position to a much higher degree of accuracy than the motor steps but that still does not give you the actual carriage position. For that you would be better served by having a magnetic or optical scale with a digital readout, in other words fit a DRO to the carriage.

Ian P

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Sign up to our Newsletter

Sign up to our newsletter and get a free digital issue.

You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy

Latest Forum Posts
Support Our Partners
cowells
Sarik
MERIDIENNE EXHIBITIONS LTD
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest

 

Donate

donate