Using magic lantern to create a parfocal lens?

Started by davniel, June 03, 2017, 09:35:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

davniel

Parfocal lenses stay in focus when the zoom is changed. Most of our photography lenses are not parfocal. I'm thinking a module could be created that would automatically adjust the focus as the zoom was changed, to create parfocal lens. I'm thinking it would work like this:

Loop{
1. The module accesses and stores the current focal length (zoom) and focus distance.
2. The module calculates the difference between the current value set and previous value set.
3. If the difference in focal length is non zero (i.e. the user zoomed in) the module sets the focus distance to a new value based on a formula (curve fit of focal length vs focal distance plot where the lens and subject are fixed)
}

Possible? Discuss!

- Dan

BBA

The idea is to dynamically control the focus distance (maintain the point) when the focal distance changes (zooming in or out).
It should be real time operation as such lenses are used when filming (and not 2 seconds later, after pumping).
Right ?

Just to help : I am not a specialist so I can get wrong...

IMHO, sorry, it is not possible for several reasons :

- precision of the zooming position returned to the camera : this relies on an encoder with a (very) limited number of states : it is only useful for exif reporting, easier optical aberrations corrections (other things I don't know) but not efficient enough in "real time" where the slightest move should be detected for the correction loop to be effective (the lenses are not made for that) ;

This is enough a reason but FYI there are more:

- precision of the focus position : here too there is another (very) limited absolute encoder (and a more precise but relative position sensor) : the big problem is you cannot (at least for the moment but don't expect too much, if only possible) move the focus motor to a given absolute position, in between, on one of the few encoder steps, to achieve a given focus distance : hereto, it is only useful for exif reporting and easier corrections.
The lenses require the bodies and the system is designed to work with autofocus purposes in mind (be it phase correlation, max contrast, dual pixel AF); on new bodies the dual pixel AF makes use of the AF motor but it is always controlled by the AF setpoint (in french "consigne autofocus"); I can only think of the predictive AF system to move the AF motor without direct AF control at each pace but this has not been studied (for rather obvious reason). 

- the lens should be calibrated (that requires to be known at design time to make it ... possible and repeatable) : cheap lenses have mechanical backlash (or "play" : in french = "il y a du jeu")

- there are optical problems (focal distance changing when focusing "focus breathing") which needs to be known at lens design time.

- in parfocal lenses if there is a need for compensation, the "brain" is located inside the lens : communicating with the body would be too slow.

- focus motor itself : cheap lenses have small DC motors with many gears (should be prone to mechanical backlash); other L USM lenses have ring piezoelectric motor (less backlash IMHO); there are now lenses  with linear motors inside, even sometimes 2 of them (cfr new Sony G lenses) which should give higher precision.


davniel

Thank you for the quick and succinct reply!

If I understand correctly, it comes down to a few issues:

1. The rotary encoders aren't precise enough.

2. The focus motor isn't precise enough to go to a set position.

3. Even if both components were precise enough, communicating with the body is too slow for real time dynamic control.

OKay, just for laughs, lets say we 3d print a clamp that couples (better) rotary encoders and servo motors externally to the lens' zoom and focus rings. Add an arduino, power source, and some good code and we've got a bulky solution, right? Not practical, but a fun project.

ilia3101

Another idea: if info about a lens is known, it might be possible to calculate roughly how much to adjust a focus motor based on focal length change, so adjusting after the zoom - could help with the accuracy issues.

I'm currently watching the sun setting 8)

a1ex

If the repeatability is good enough, it's totally doable with a Lua script.

Of course, the hardest part is calibration (which would include backlash compensation and the other issues BBA already pointed out). All it needs is lots of patience. Rinse and repeat for every single lens you need to use.

davniel

Awesome thanks for all the replies! I'll do some investigation and get back to you all.