×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Autofocus failure

  • Posts: 8
  • Thank you received: 0
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]
1 year 11 months ago #82278

Please Log in or Create an account to join the conversation.

  • Posts: 459
  • Thank you received: 69

Replied by Jerry Black on topic Autofocus failure

Could you not accommodate for this limitation by adjusting the out step mulitple in the Focus Mechanics tab?
1 year 11 months ago #82281

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 0

Replied by Brian McBride on topic Autofocus failure

Hi Jerry,

Thanks for responding.

I am not familiar with the code, but as far as I can see, the outstep multiplier is not used when computing the 'requestedPostiion' at which to start the second pass. In most cases when calling the setupSecondPass method its uses the default margin value of 2, except in one case when its running of road, it has a last fling with 0.5.

When I wrote 'initial step multiplier' I meant 'outstep multiplier'. Basically I'm suggesting that if it was preferred not to change the UI and create a parameter to allow the user to set the margin value, then using the outstep multiplier somehow might make sense.

Another route might be to figure out how to set a backlash value. I haven't figured out yet why that's disabled, but I'm guessing it might need a change in the GPhoto driver to enable it.
Last edit: 1 year 11 months ago by Brian McBride. Reason: missed a bit
1 year 11 months ago #82286

Please Log in or Create an account to join the conversation.

Time to create page: 0.439 seconds