Brian McBride created a new topic ' Autofocus failure' in the forum. 2 years ago

I'm getting autofocus failures because, at the end of the first pass, the focus is not moved back out far enough to start the second pass. Sometimes it moves far enough. Sometimes not. I'm using the linear algorithm.

I had a look at the code and found:

<code>
// Arbitrarily go back "margin" steps above the best position.
// Could be a problem if backlash were worse than that many steps.
requestedPosition = std::min(static_cast<int>(firstPassBestPosition + stepSize * margin), maxPositionLimit);
</code>

The margin value used is 2.

I have changed that to 8, rebuilt from source and confirmed that with a larger margin value the focus is moved far enough to start a second pass.

Is there any interest in modifying the code to either allow some user control of the margin value or having a different default value (maybe min(2, half the initial step multiplier) )?

[Hardware = EOS R + canon 300mm, driver = GPhoto]

Read More...