Page 1 of 1

Rerun focus when initial focus does not fail but cannot find best focus

Posted: Tue Dec 16, 2025 4:29 am
by yomamma
I run my C11 at f10 on my CEM120 and get good results.

I have used Sharpcap for years now and my scripts will usually always run to the end so I get a good nights sleep.

My only problem is with focusing the C11 when seeing is about average or a little less. The seeing will jump around a bit and I will generally get a focus curve that works, but occasionally I will get an outlier or two on the curve created by a spate of bad seeing that will preclude the routine from finding the best focal point. When I get around to focusing again, in most cases, I never recover from the previous missed new focal point.

I have tried the sequence command ---Retry up to <Maximum Retry Count>--- but it looks as though not finding the focus does not raise an error.

What I have found is that I can usually get the focus to work on the second or third try even though I may get outliers they are not consistently severe enough to impact the final score.

Is it possible to have something like the ---Retry up to --- when the focus routine fails to find a new focal point? This would allow for at least a few more tries at it which in my case might allow the script to continue with good focus.

Thanks for considering

Re: Rerun focus when initial focus does not fail but cannot find best focus

Posted: Tue Dec 16, 2025 7:34 am
by Gfischer
I had the same issue. I changed to averaging 2 or 3 frames to help with poor seeing.

Re: Rerun focus when initial focus does not fail but cannot find best focus

Posted: Tue Dec 16, 2025 2:55 pm
by admin
Hi,

any chance you can find the SharpCap log from a run that failed in that way and didn't trigger the retry? Looking at the code, I would expect a failure to find the best focus point to fail that refocus step with an error and that to cause the retry. I see the retry happening when I test too, so I suspect that there may be some subtlety in the way it fails that is causing the issue.

cheers,

Robin

PS. Is your version of SharpCap up-to-date?

Re: Rerun focus when initial focus does not fail but cannot find best focus

Posted: Tue Dec 16, 2025 3:48 pm
by yomamma
Hey Robin,

I will go back and see if I can find a log with the failure . This happened just the other night and I looked to see if it retried and I could not find where it did but I only gave it a cursory look. I will get back.

Thanks

Re: Rerun focus when initial focus does not fail but cannot find best focus

Posted: Wed Dec 17, 2025 1:45 pm
by admin
Hi,

just to make it easier to check, if the retry is happening you will find lines like this in the log

Code: Select all

Debug  	14:54:47.892159	#1 	Sequencer : Info      : 'Ignoring error (about to retry) : SharpCap did not find a best focus position in the range 24400 to 25600' while running step Refocus using the same settings as the most recently used autofocus run					in void SharpCap.Sequencer.SequencerContext.Info(string message)
Debug  	14:54:47.893864	#1 	Sequencer : Info      : 'Retry #1 of 1' while running step Refocus using the same settings as the most recently used autofocus run					in void SharpCap.Sequencer.SequencerContext.Info(string message)
those will appear between the first failuer and the retry, and then again between subsequent retries if you allowed more than one.

cheers,

Robin