Step Size for sensor stacking

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Step Size for sensor stacking

Post by ray_parkhurst »

I'm experimenting with sensor stacking and am wondering how to calculate the required step size. In my first attempt I correlated sensor + lens stacking total height (ie actual physical height) versus the required stacking distance for sensor spacing, but it would be much more convenient to have a table or formula to work from so I don't need to do it twice.

Adalbert
Posts: 2428
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hi Ray,

I’m afraid I haven’t caught your problem 

I have implemented two simple rules in my rail:
1.) for the microscope lenses:
DOF = 0,00055 / (NA * NA)

2.) for the magn-lenses as Rodagon 50
DOF = 0,04 * A * ( (mag+1) /magn * magn)

BR, ADi

Alan Wood
Posts: 382
Joined: Wed Dec 29, 2010 3:09 pm
Location: Near London, U.K.
Contact:

Post by Alan Wood »

Ray

There are tables here:

http://zerenesystems.com/cms/stacker/do ... romicrodof

Alan Wood

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

ADi [and Alan]...I'm not asking about DOF calc per se. That can be calculated approximately using the simple formulae you quote. These give the direct physical DOF on subject for a given NA or nominal aperture + magnification. In general I just look up Rik's table for different NAs since I don't remember the formula. This number works perfectly well when stepping the lens+camera together, ie with a constant magnification at the critical focus plane. The step size of course is up to the user to decide based on desired overlap of the DOF slices.

The problem I'm worried about is when the camera is moved with lens in fixed position, ie fixed working distance. In this case, the camera must be moved a longer distance to focus across the subject topography than if the lens+camera were moved. As an example, the total topography of a Lincoln Wheat Cent is ~300um. Let's say that is divided into 10 steps of 30um each, total of 11 shots. Using lens+camera stepping, the step sizes would be 30um, but using camera stepping, the total movement to focus from lowest to highest focal planes is larger than 300um, so each step is larger than 30um. What I am looking for is a data table, formula, or spreadsheet which calculates the required step size for camera stepping which gives the same focal plane spacing as I would get with lens+camera stepping. The formula could either be the DOF expressed as camera stepping distance, or a relationship between critical focus plane movement and camera movement.

rjlittlefield
Site Admin
Posts: 23564
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Moving the sensor while the lens and subject are fixed, is nicely analogous to moving the subject while the lens and sensor are fixed.

The same formulas apply, with appropriate substitutions of the variables.

So, you could use for example the 1/4-lambda wavefront error rule that DOF = lambda/NA^2, by using NA at the sensor, to wit, NA_sensor = 1/(2*Feff).

Regardless of which formulas you like to use, it will work out that in the macro/micro regime, Depth Of Focus at the sensor is equal to magnification squared times Depth of Field at the subject.

Yes, this does mean that optical magnification stretches the subject along the optical axis. The aspect ratio of the 3D image is different from the aspect ratio of the 3D subject by a factor of m, the magnification.

--Rik

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

rjlittlefield wrote:Moving the sensor while the lens and subject are fixed, is nicely analogous to moving the subject while the lens and sensor are fixed.
Not really analogous. In the first case, the working distance between the subject and lens is kept constant, and moving the sensor changes the magnification slightly. In the second case, the working distance is varied, while the magnification stays the same.

edited to add: OK, I see the analogy, but it doesn't help me. As I've stated a few times, I am not interested in DOF calc per se, just in the relationship between the required step sizes.

further edit: reading your last statement maybe gives me a clue:

"Yes, this does mean that optical magnification stretches the subject along the optical axis. The aspect ratio of the 3D image is different from the aspect ratio of the 3D subject by a factor of m, the magnification."

So is the answer to my question that I would move the sensor m times as far as I would move the subject?

another edit: actually, I would move the sensor m^2 times as far, correct?

rjlittlefield
Site Admin
Posts: 23564
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

ray_parkhurst wrote:another edit: actually, I would move the sensor m^2 times as far, correct?
Yes, that sounds right.

I worded the same concept this way (emphasis added):
Regardless of which formulas you like to use, it will work out that in the macro/micro regime, Depth Of Focus at the sensor is equal to magnification squared times Depth of Field at the subject.
--Rik

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

rjlittlefield wrote:
ray_parkhurst wrote:another edit: actually, I would move the sensor m^2 times as far, correct?
Yes, that sounds right.

I worded the same concept this way (emphasis added):
Regardless of which formulas you like to use, it will work out that in the macro/micro regime, Depth Of Focus at the sensor is equal to magnification squared times Depth of Field at the subject.
--Rik
I just paraphrased your input in a form to answer my question.

Thanks for putting it in "proper perspective". I like simple answers. I will test both ways quantitatively and report back.

Edited to add: So to be clear, if I look at table 2-C, it gives 55um subject DOF for a 0.1NA objective. If I am operating at 2x magnification, and stacking using camera/sensor, then I would have 220um sensor DOF. The way I would test this is by critically-focusing on two subject planes using both stacking methods. The sensor method should require 4x the movement between the two planes versus the lens+sensor method.

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

OK, here are my measured numbers:

m=1.68x, m^2=2.82

Sensor Delta-Z: 859um
Sensor+Lens Delta-Z: 266um

Delta-Z ratio: 3.23

I'm confident in the critical focus measurements within 20um or so. The Sensor method I used had some potential "play" that could account for the differences I suppose, but I would think it would go the other direction, ie when moving the sensor farther from the lens, the lens would pull toward the sensor, and any play in the system would tend to shorten the measured Delta-Z.

Is there a second-order effect that could explain the 14.5% discrepancy?

rjlittlefield
Site Admin
Posts: 23564
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

ray_parkhurst wrote:Is there a second-order effect that could explain the 14.5% discrepancy?
Answer #1: not that I know of. The math is pretty straightforward on that point, in all the models. For example, NA_sensor = NA_subject/m (with no second order effects that I know of), which implies that DOF_sensor = DOF_subject*m^2 (with a second-order effect that is tiny until one of the NA's approaches 1).

I would be very curious to know how you're making your measurements, because DOF is notoriously hard to measure accurately.

As illustration, I suggest to download the .zip at https://www.photomacrography.net/forum/ ... hp?t=23751 and load it into Zerene Stacker to quickly compare the images.

When I do that, viewing at 200%, I'm hard-pressed to tell the difference visually between wavefront errors of 0.1875, 0.2500, and 0.3125.

That's a range of +-25%, right in the area where we'd normally like to be operating. So I personally am not at all surprised to hear about a 14.5% discrepancy in experimental data.

What I am surprised about, is to hear confidence to within 20um or so, even for a Delta-Z of 266 um. How are you making the measurement?

--Rik

rjlittlefield
Site Admin
Posts: 23564
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

ray_parkhurst wrote:Is there a second-order effect that could explain the 14.5% discrepancy?
Answer #2: same as answer #1, but with a different analysis.

Suppose we're measuring large Delta-Z's, much beyond the focus range so we don't need to worry about DOF. Then all we need to worry about is the basic lens equation, 1/f=1/o+1/i .

For example let me assume that your m=1.68 is achieved with a 100 mm lens.

Then i=268 and o=159.5238.

Now let's perturb o by 266um.

Then o=159.7898 and i=267.2526. That is, i gets perturbed by 747.4um.

Now, 747.4/266 = 2.810, versus 1.68^2=2.822 .

So yes, with large perturbations there is a second order effect, but it seems far too small to account for a discrepancy of 14.5% in any test I can imagine you performing.

--Rik

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

rjlittlefield wrote:
ray_parkhurst wrote:Is there a second-order effect that could explain the 14.5% discrepancy?
Answer #2: same as answer #1, but with a different analysis.

Suppose we're measuring large Delta-Z's, much beyond the focus range so we don't need to worry about DOF. Then all we need to worry about is the basic lens equation, 1/f=1/o+1/i .

For example let me assume that your m=1.68 is achieved with a 100 mm lens.

Then i=268 and o=159.5238.

Now let's perturb o by 266um.

Then o=159.7898 and i=267.2526. That is, i gets perturbed by 747.4um.

Now, 747.4/266 = 2.810, versus 1.68^2=2.822 .

So yes, with large perturbations there is a second order effect, but it seems far too small to account for a discrepancy of 14.5% in any test I can imagine you performing.

--Rik
Yes, that's a really small effect.

For the measurement, I am using the readout from the stepper controller. I hadn't considered there would be any significant error in stepping accuracy but to be sure I will repeat the measurement using a micrometer.

It seems pretty easy to find a critical focus plane visually within 10um at ~2x with 0.1NA, so total distance between any two planes can be found within 20um. Total distance is not that relevant as long as the system itself is accurate.

ray_parkhurst
Posts: 3417
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

I re-did the measurement with micrometer moving the stage. I should have realized this before, but when doing this manually it becomes obvious that more movement is required to focus with the sensor method than sensor+lens method, so accuracy is scaled with the movement ratio. When using software to move the rail the difference was not at all obvious. With sensor+lens method I am still confident in 10um accuracy of each critical focus plane, but for the sensor method I suppose this increases to ~30um. So the Delta-Z accuracies would be 20um for sensor+lens, and 60um for sensor method.

The result I got with the micrometer is:

290um sensor+lens
760um sensor

I would have expected 733um based on m^2 ratio. This would represent an error of 27um in Delta-Z for sensor method, or 10um for sensor+lens, so this is well within the measurement tolerances.

edited to add: the two tests were not done at the same exact reference planes as previous. This time I chose two dust particles as reference markers, and these were at slightly different locations than first test, but consistent between the two methods.

rjlittlefield
Site Admin
Posts: 23564
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

I'm glad to hear that the new measurements are consistent within measurement accuracy.

1/f = 1/o + 1/i is quite accurate, given proper consideration for principal planes.

In the case where there's no change in the spacing between optical elements, then the optics work as a single "thick lens", and front and back focus distances should change in essentially perfect accordance with the formula.

--Rik

Post Reply Previous topicNext topic