Autofocus Gets An Error

Somewhere to ask questions about the best way to use SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Post Reply
ChrisM5527
Posts: 2
Joined: Mon Nov 08, 2021 10:55 pm

Autofocus Gets An Error

#1

Post by ChrisM5527 »

Hi

I get this error "SharpCap did not find a best focus position in the range 24800 to 25200" whenever I try the Autofocus feature.

I got this in real life and while using the simulation modes.

Could someone tell me what I am doing wrong? I'd like to incorporate this into my sequencing after filter changes, etc.

Thanks,

Chris
User avatar
admin
Site Admin
Posts: 13287
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Autofocus Gets An Error

#2

Post by admin »

Hi,

during the scan, SharpCap will draw a graph of the quality of focus (vertical position) for the different focuser positions. Depending on the focus tool being used, it can be that high values mean good focus (contrast detection) or low values mean good focus (star FWHM measurement for instance).

In order for SharpCap to be confident that it has found the best focus position, the graph needs to have either a clear peak with lower values each side (for contrast detection - when high focus scores are best) or a clear dip with higher values each side (for FWHM measurements where low scores are best). Here's a picture of a 'good' graph for contrast detection with a clear peak

Image

The message you are getting indicates that SharpCap didn't find the clear peak (or dip) that it needed to find in the given range. There can be a number of reasons for this - for instance the peak/dip can be right one end of the graph - that's no good because SharpCap can't be sure that focus isn't going to get even better beyond the end of the graph. Another reason is that there is no real variation in the focus score - perhaps just random flutuations with no pattern.

A good starting point when you see this error is to watch the shape of the graph and also to extend the region that is scanned to include a wider range of positions to see if you can locate the best focus peak.

cheers,

Robin
ChrisM5527
Posts: 2
Joined: Mon Nov 08, 2021 10:55 pm

Re: Autofocus Gets An Error

#3

Post by ChrisM5527 »

Thanks for the reply Robin.

I understand this, and when doing the real life trial, I use MFWHM to manually get the correct focus. Which for me is about 3.7. But when I run the auto focus from that point, I always get that Error. Maybe I have a mechanical issue with the focuser but it is a Feather Touch (with their stepper motor attached) on an AP scope. I will check next time. But something seems to be wrong from a SC perspective (possibly so). Would like to hear if maybe there is some pre-check/pre-action that I did not do?

Also, the FWHM option is greyed out on my copy. Not sure why?

Lastly, doing the simulated test (I was doing this to trial some script), I inserted the autofocus before the light exposure sequence and the simulated autofocus came out flat (of course it did) and I got the error then (understandable) but it crapped out the script. Perhaps put a fake 'V' curve into the simulated data so that the script will continue?

Thanks,

Chris
User avatar
admin
Site Admin
Posts: 13287
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Autofocus Gets An Error

#4

Post by admin »

Hi Chris,

if you get a chance, grab a screenshot showing the graph you get the next time (if you get the error again) - that will help diagnose the problem. One issue can be related to backlash - if the focuser movement while measuring is actually just taking up the backlash due to a change in movement direction then the focuser position number can change a lot, but the focuser will not physically be moving. Just random fluctuations in the focus score measurement can sometimes give you an FWHM valley (or something that looks like one) in this case. SharpCap tries to spot this problem by ensuring that the best fit curve explains a good fraction of the variability (50% or more) in the focus score before it considers it has found a best focus point.

I can't see any good reason why the FWHM should be disabled for you (providing you have a camera open) - can you send a screenshot showing that so I can dig further please.

On the subject of using the simulated camera, this will work if you set your Focuser to 'None' in the settings before opening the simulated camera. When the focuser is set to 'None' then an internal simulated focuser is used which does affect the image. When you have an ASCOM focuser selected then that is used, even though it will not affect the image. This is really because you may want to use the simulated camera in the way you do (simulated focusing) or as a way to test out your real ASCOM focuser without using a real camera.

cheers,

Robin
Post Reply