## Houston... we have a problem

**Moderators:** Pau, rjlittlefield, ChrisR, Chris S.

### Houston... we have a problem

Friends: I built a spreadsheet to calculate the number of steps and the DOF for stacking. For photographic lenses everything is fine. The theory and data fit perfectly; however, the same does not happen with the calculation for finite microscope lenses, I used the augmentation formula:

m = L * Nominal Magnification / (L Nominal-10); where 10 is the nominated distance in mm, from the base of the lens wire to the focus inside the lens (later with that data I use Lefkowitz's formula to calculate the steps and the DOF). But ... the calculated magnification does not fit the empirical data:

In tests for an aps-c sensor (23.6 mm) and an Amscope Plan 4X (L Nominal 160; m nominal 4X).

Reading on the sensor: 10.6 mm

Magnification (23.6 / 10.6) = 2.2X

L Real = 90mm.

But if I get "L" by the above formula (cleaning the value of

L = m * (L Nominal-10) / Nominal Magnification); (10 is the distance in mm from the base to a focus in the microscope lens)

the "theoretical L" would be: 2.2 * (160-10) / 4 = 84 mm. That is 6mm less.

Ok, maybe it's an approximation problem (although I doubt it, it's a spreadsheet)

Second test:

Reading on the sensor: 6.1 mm

Magnification = 3.9X

L real = 140mm.

L theoretical = 145 mm, (?) Now we have 5 mm more!.

I have taken several samples and in all there is a difference between real L and theoretical L, for example: for 7.4X the difference is 44 mm and for 8.4X the difference is 33 mm, it is not even linear!.

Obviously, there is a variable that is not being considered, but when reviewing the formulas I have not found anything out of the ordinary.

What am I forgetting?

Thank you and regards

m = L * Nominal Magnification / (L Nominal-10); where 10 is the nominated distance in mm, from the base of the lens wire to the focus inside the lens (later with that data I use Lefkowitz's formula to calculate the steps and the DOF). But ... the calculated magnification does not fit the empirical data:

In tests for an aps-c sensor (23.6 mm) and an Amscope Plan 4X (L Nominal 160; m nominal 4X).

Reading on the sensor: 10.6 mm

Magnification (23.6 / 10.6) = 2.2X

L Real = 90mm.

But if I get "L" by the above formula (cleaning the value of

L = m * (L Nominal-10) / Nominal Magnification); (10 is the distance in mm from the base to a focus in the microscope lens)

the "theoretical L" would be: 2.2 * (160-10) / 4 = 84 mm. That is 6mm less.

Ok, maybe it's an approximation problem (although I doubt it, it's a spreadsheet)

Second test:

Reading on the sensor: 6.1 mm

Magnification = 3.9X

L real = 140mm.

L theoretical = 145 mm, (?) Now we have 5 mm more!.

I have taken several samples and in all there is a difference between real L and theoretical L, for example: for 7.4X the difference is 44 mm and for 8.4X the difference is 33 mm, it is not even linear!.

Obviously, there is a variable that is not being considered, but when reviewing the formulas I have not found anything out of the ordinary.

What am I forgetting?

Thank you and regards

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

The big problem is that your formula is wrong.

For infinite objectives, there is a correct formula that is similar to yours. It says that m = NominalMagnification * (TubeLensFL / NominalTubeLensFL). This works because with an infinite objective, the distance from focused subject to objective does not change when you use a tube lens with a different FL.

But with finite objectives, when you change the distance from objective to sensor, the distance from objective to focused subject also changes. For example as you move the objective closer to the sensor, you also must put the subject farther away from the objective to maintain focus. As a result the magnification drops faster than your formula predicts.

For a finite objective, the proper formula is that

m = ((L+K) / FL) - 1

where FL is the focal length of the objective, and K is a constant that depends on the lens design.

With an ordinary lens, the focal length is marked on the lens, and we usually pretend that K is zero. In that special case the formula simplifies to

m_ordinary = (L/FL) - 1

For example if you place a 50 mm lens at 50 mm away from the sensor, you get m=0, since (50/50)-1=0. This is infinity focus, like for taking a landscape picture. Then if you add another 100 mm of extension, you get m=2, since ((100+50)/50)-1=2. The relationship is linear: every time you increase the extension by a distance equal to the focal length, the magnification increases by 1.

A finite microscope objective is just like an ordinary lens, except that you do not initially know the FL of the objective, and you don't know the value of K.

As reasonable approximations, you might use K=0 and FL = LNominal/(m+1), so then FL=32 mm for your lens. (Crosscheck: m=(160/32)-1=4.)

But it is simple to determine FL by measuring magnification at two different extensions, and then calculating as:

FL = (L1-L2)/(m1-m2)

Once you know the FL, then you can calculate K based on m = ((L+K) / FL) - 1, for one of the pairs of L and m that you already measured.

From your post, it seems that you have measured

m=2.2, L=90

m=3.9, L=140

Given these measurements, we can calculate FL = (140-90)/(3.9-2.2) = 29.41 .

Than we have that 2.2 = ((90+K)/29.41)-1, which means that K = 4.1 .

Once you have accurately determined FL and K, the formula will make accurate predictions.

The underlying principle is basic optics. When focused, the distances from lens to object (o) and lens to image (i) satisfy 1/f=1/o+1/i, and the magnification is m=i/o.

From this, two simple equations can be obtained:

i = f * (m+1)

m = (i/f) - 1

However, when applying these formulas, you have to take the measurements from the objectives's "principal planes". The role of K, in the formula that I gave earlier, is to represent the position of the "rear principal plane" that is used in measuring distances to the sensor.

Please study this analysis, take a new set of measurements if necessary, and see if you get a better match between theory and experiment.

--Rik

For infinite objectives, there is a correct formula that is similar to yours. It says that m = NominalMagnification * (TubeLensFL / NominalTubeLensFL). This works because with an infinite objective, the distance from focused subject to objective does not change when you use a tube lens with a different FL.

But with finite objectives, when you change the distance from objective to sensor, the distance from objective to focused subject also changes. For example as you move the objective closer to the sensor, you also must put the subject farther away from the objective to maintain focus. As a result the magnification drops faster than your formula predicts.

For a finite objective, the proper formula is that

m = ((L+K) / FL) - 1

where FL is the focal length of the objective, and K is a constant that depends on the lens design.

With an ordinary lens, the focal length is marked on the lens, and we usually pretend that K is zero. In that special case the formula simplifies to

m_ordinary = (L/FL) - 1

For example if you place a 50 mm lens at 50 mm away from the sensor, you get m=0, since (50/50)-1=0. This is infinity focus, like for taking a landscape picture. Then if you add another 100 mm of extension, you get m=2, since ((100+50)/50)-1=2. The relationship is linear: every time you increase the extension by a distance equal to the focal length, the magnification increases by 1.

A finite microscope objective is just like an ordinary lens, except that you do not initially know the FL of the objective, and you don't know the value of K.

As reasonable approximations, you might use K=0 and FL = LNominal/(m+1), so then FL=32 mm for your lens. (Crosscheck: m=(160/32)-1=4.)

But it is simple to determine FL by measuring magnification at two different extensions, and then calculating as:

FL = (L1-L2)/(m1-m2)

Once you know the FL, then you can calculate K based on m = ((L+K) / FL) - 1, for one of the pairs of L and m that you already measured.

From your post, it seems that you have measured

m=2.2, L=90

m=3.9, L=140

Given these measurements, we can calculate FL = (140-90)/(3.9-2.2) = 29.41 .

Than we have that 2.2 = ((90+K)/29.41)-1, which means that K = 4.1 .

Once you have accurately determined FL and K, the formula will make accurate predictions.

The underlying principle is basic optics. When focused, the distances from lens to object (o) and lens to image (i) satisfy 1/f=1/o+1/i, and the magnification is m=i/o.

From this, two simple equations can be obtained:

i = f * (m+1)

m = (i/f) - 1

However, when applying these formulas, you have to take the measurements from the objectives's "principal planes". The role of K, in the formula that I gave earlier, is to represent the position of the "rear principal plane" that is used in measuring distances to the sensor.

Please study this analysis, take a new set of measurements if necessary, and see if you get a better match between theory and experiment.

--Rik

I have done the numbers and it is much closer to the sampled values. It is possible that some differences are due to approximations in the calculation of m over the screen in the sampling or to the estimation of the location of the focus in the lens (which can change the total L).

Absolutely grateful for the explanation.

If you don't have problem, I would like to publish your explanation in another macrophotography forum (translated into Spanish), of course I will do the references.

regards

Fernando

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

Great, I'm glad to hear that the numbers are working out better.

Yes, feel free to translate and repost, with reference back here.

One clarification...

--Rik

Yes, feel free to translate and repost, with reference back here.

One clarification...

In the method that I describe, the parameter K should take care of this issue. Just pick some fixed mark on the lens -- any mark will do -- and measure all of your L's from that same mark. Then the K that you compute will work for all of those L's, and also for any other L measured from the same mark. What you are doing is essentially to locate the "rear principal plane" of the lens, which is found at a distance K away from the fixed mark. If you choose a different mark, then you'll get a new K which still locates the rear principal plane at the same place either way.Lopezlago wrote:It is possible that some differences are due to ... estimation of the location of the focus in the lens (which can change the total L).

--Rik

My idea is to locate the focus of the microscope lens, so I think (am I wrong?) to replace the nominal parameters to determine a real L, so that I could clear the precise location of the focus and correct the L total.

For my Amscope Plan 4X I considered 10 mm, but when looking for a value that eliminated the small differences I got 20.8 mm which adjusts the values between 2X and 7X.

Fernando

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

I am not sure what you mean: "locate the focus of the microscope lens".

The Amscope Plan 4X is designed to be used on a microscope with a 160 mm tube.

In that use, the focused image must be formed 10 mm from the end of the tube, because that's where the eyepiece expects it to be.

So, as designed, the objective will give about 4X magnification when it is focusing an image at 150 mm from the shoulder of the mounting threads, as shown at http://www.photomacrography.net/forum/v ... hp?t=12147 . The magnification may not be exactly 4X, because of design and manufacturing tolerances.

If you want to change the magnification, then you have to focus at some distance other than 150 mm from the shoulder of the mounting threads.

The change in focus distance, from lens to sensor, is simple to compute. You just change it by one focal length (FL) for each 1X change in magnification. So, to get 3X magnification instead of 4X, you would focus the image at (150 - FL) mm from the shoulder of the mounting threads. To get 6X magnification instead of 4X, you would focus the image at (150+2*FL) mm from the shoulder of the mounting threads.

We can write this as a new formula:

If you want magnification m, then you need L (measured from the shoulder of the mounting threads) to be about

L = 150 + (m-4)*FL

More accurately, it is

L = 150 + (m-mAt150)*FL

where mAt150 is whatever magnification the lens actually gives at L = 150. This is nominally 4 but probably something a little different from that.

----------

There is another way to think about the calculation, which you may prefer.

The additive change in magnification is linearly related to the additive change in extension.

So, if you have measured magnifications m1 and m2 at two different extensions L1 and L2, then for any other magnification m you can compute extension L this way:

L = L1 + (L2-L1)*(m-m1)/(m2-m1)

Notice that

A) the equation is linear in m,

B) if m=m1, then L=L1

C) if m=m2, then L=L2

Is this formula more comfortable?

--Rik

The Amscope Plan 4X is designed to be used on a microscope with a 160 mm tube.

In that use, the focused image must be formed 10 mm from the end of the tube, because that's where the eyepiece expects it to be.

So, as designed, the objective will give about 4X magnification when it is focusing an image at 150 mm from the shoulder of the mounting threads, as shown at http://www.photomacrography.net/forum/v ... hp?t=12147 . The magnification may not be exactly 4X, because of design and manufacturing tolerances.

If you want to change the magnification, then you have to focus at some distance other than 150 mm from the shoulder of the mounting threads.

The change in focus distance, from lens to sensor, is simple to compute. You just change it by one focal length (FL) for each 1X change in magnification. So, to get 3X magnification instead of 4X, you would focus the image at (150 - FL) mm from the shoulder of the mounting threads. To get 6X magnification instead of 4X, you would focus the image at (150+2*FL) mm from the shoulder of the mounting threads.

We can write this as a new formula:

If you want magnification m, then you need L (measured from the shoulder of the mounting threads) to be about

L = 150 + (m-4)*FL

More accurately, it is

L = 150 + (m-mAt150)*FL

where mAt150 is whatever magnification the lens actually gives at L = 150. This is nominally 4 but probably something a little different from that.

----------

There is another way to think about the calculation, which you may prefer.

The additive change in magnification is linearly related to the additive change in extension.

So, if you have measured magnifications m1 and m2 at two different extensions L1 and L2, then for any other magnification m you can compute extension L this way:

L = L1 + (L2-L1)*(m-m1)/(m2-m1)

Notice that

A) the equation is linear in m,

B) if m=m1, then L=L1

C) if m=m2, then L=L2

Is this formula more comfortable?

--Rik

I have done the tests carefully to have results that are not affected by rounding or approximations:

Amscope Plan 4X and 23.6mm sensor (APS-C)

T1: 10.60 and L = 90mm; m = (23.6 / 10.6) = 2.23

T2: 5.60 and L = 150mm; m = (23.6 / 5.6) = 4.21

A doubt, the nominal magnification for 150mm (160-10) is 4X (I think that 0.21X maybe it will be excessive), well ..

calculated whithout rounded:

FL = (150-90) / (4.21-2.23) = 30.18

K = 30.18 * (2.23 + 1) -90 = 7.38

Crosscheck: L = 230mm (at the top of the bellow)

m calculated = ((230 + 7.38 ) / 30.18 ) -1 = 6.86

m testing at L = 230mm; 23.6 / 3.44 = 6,86X

I will prove the formula: L = L1 + (L2-L1) * (m-m1) / (m2-m1)

L=90+(150-90)*(6,86-2,23)/(4,21-2,23)=230!!

Thank you for your patience

Fernando

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

Fernando,

I saw your last post earlier today, while it still had the error that made your results look inconsistent. (I think it showed measured m="7.38" at L=230, versus 6.86 expected. Perhaps the value for K got inserted where the measured magnification was supposed to have been?)

Anyway, that version of your post made me question my own writings! So I did some further investigation of my own, which I will document here for completeness.

Theory says that the formulas I have given are exact within the "thick lens model". The physical objective will be different from thick lens model by a little bit due to curvature of field and other geometric distortions, but it should be quite close.

To confirm the formulas, I ran a physical experiment.

I set up an Amscope basic achromat (not a plan achromat) on bellows to a Canon T1i, shooting a micrometer slide. At each of 5 different bellows extensions, I shot a picture. I loaded the pictures into Photoshop and counted pixels in 1 mm on the slide. From the pixel counts and sensor size I calculated magnification at each extension. Then I used the first two extensions and magnifications as L1, m1, L2, and m2 in the formulas. From those, for each of the other measurements, I calculated theoretical extension based on measured magnification, and theoretical magnification based on measured extension. Pixel counts are probably accurate to +-4, and length measurements to +- 0.5 mm.

Here are the results:
To my eye these look consistent to within measurement error.

Now that I see your latest results, I am pleased to see that the formulas work for you also. Whew!

As for your objective giving magnification 4.21X instead of 4X, I am a little surprised that it is so much different, but it's not far enough different to make me think that surely something has gone wrong.

Still, I think I should mention that if something about your measurement procedure makes all the measurements be wrong by the same factor (say, 5% too large), then calculations like we've done would still end up accurately matching all L's with the corresponding as-measured magnifications.

This fact is clear if we go through the math -- replace all m's with c*m's and all the c's cancel. But I didn't realize that up front. Instead, I wondered if perhaps your calculations had used a wrong sensor size or some such, ran a calculation on that assumption, and was surprised to see that it made no difference at all in terms of consistency. Overlooking an "obvious" feature of the math would be a little embarrassing, except that I've had similar experiences so many times that I've come to think of them as routine.

--Rik

I saw your last post earlier today, while it still had the error that made your results look inconsistent. (I think it showed measured m="7.38" at L=230, versus 6.86 expected. Perhaps the value for K got inserted where the measured magnification was supposed to have been?)

Anyway, that version of your post made me question my own writings! So I did some further investigation of my own, which I will document here for completeness.

Theory says that the formulas I have given are exact within the "thick lens model". The physical objective will be different from thick lens model by a little bit due to curvature of field and other geometric distortions, but it should be quite close.

To confirm the formulas, I ran a physical experiment.

I set up an Amscope basic achromat (not a plan achromat) on bellows to a Canon T1i, shooting a micrometer slide. At each of 5 different bellows extensions, I shot a picture. I loaded the pictures into Photoshop and counted pixels in 1 mm on the slide. From the pixel counts and sensor size I calculated magnification at each extension. Then I used the first two extensions and magnifications as L1, m1, L2, and m2 in the formulas. From those, for each of the other measurements, I calculated theoretical extension based on measured magnification, and theoretical magnification based on measured extension. Pixel counts are probably accurate to +-4, and length measurements to +- 0.5 mm.

Here are the results:

Code: Select all

```
Pixels per 1 mm object L m Calculate L from m Calculate m from L
849 150 3.984
1604 260 7.527
1193 200 5.598 200.1 5.595
465 93 2.182 94.1 2.148
647 120 3.036 120.6 3.018
```

Now that I see your latest results, I am pleased to see that the formulas work for you also. Whew!

As for your objective giving magnification 4.21X instead of 4X, I am a little surprised that it is so much different, but it's not far enough different to make me think that surely something has gone wrong.

Still, I think I should mention that if something about your measurement procedure makes all the measurements be wrong by the same factor (say, 5% too large), then calculations like we've done would still end up accurately matching all L's with the corresponding as-measured magnifications.

This fact is clear if we go through the math -- replace all m's with c*m's and all the c's cancel. But I didn't realize that up front. Instead, I wondered if perhaps your calculations had used a wrong sensor size or some such, ran a calculation on that assumption, and was surprised to see that it made no difference at all in terms of consistency. Overlooking an "obvious" feature of the math would be a little embarrassing, except that I've had similar experiences so many times that I've come to think of them as routine.

--Rik

I think initially I was not as careful as I said. To make sure I did not have any doubt, I measured the test in printed photos, but in the crosschecking I only reviewed it in the live view of the camera with a caliper. (error!). After write the post, I remembered my friend Murphy and, well, I went back to the camera and printed the photo and ... eureka, the numbers fit perfectly.

The difference with the nominal magnification is rare, but it's not a problem for me.

I really appreciate your help.

Fernando

https://www.facebook.com/groups/macroex ... 349538160/