Improved Autofocus Algorithm

Recently, James Lamb posted a YouTube video on his channel that proposes an additional means to compute best focus using the number of stars detected. Since SGP has issues in auto-focusing SCTs or scopes with central obstructions, James did a detailed analysis comparing HFR with number of stars detected during an autofocus run. The number of stars detected correlates with the HFR, but using the number of stars detected seems to be more sensitive and robust to find the optimal focuser position for an SCT.

The other improvement to the autofocus routine would be to add a hyperbolic curve fit and perhaps use it along with the parabolic fit to determine optimal focus.

I continue to struggle with obtaining a good autofocus result with my Celestron 9.25" Edge HD, unless seeing is above average, even with a 0.7x focal reducer. SCT’s with long focal length are a challenge for the autofocus routine. For my scope, I am constrained in the number of steps used for each focus point where donuts will appear and a V-shape curve with a 3x step range is almost impossible for me to achieve without dog ears appearing. I do see that the number of stars detected increases significantly as the scope nears its best focus.

Mark W

1 Like

I have to say that SGP does a fine job with my scope - a 10 inch iDK which has a very large central obstruction and a Moonlight night-crawler for a focuser…

What version of SGP are you running? We’ve had a hyperbolic fit for about the last 9 months which works extremely well. We’ll look into adding the # of stars as an additional metric as well.



I am running the latest version. I thought the curve fit was a parabolic or polynomial.



My AT-10RC (2000mm f/l) does pretty well in the latest version of SGP as long as I give it enough exposure, and it has a pretty big central obstruction.

With my ZWOASI1600 mono camera, I am taking 8 to 10 sec exposures, Lum filter, gain 200, 2x2 binning. What settings do you use?

Mark W

Using a f3,2newtonian and an asi1600 I can’t reach perfect focus with the SGP autofocus, I need manual adjustment to get it. I use 13 set points and the HFR ratio varries x4 during the process.

I use a 8" RC @ f/8 mostly with a Optec TCF-S focuser / ATIK 383L+ camera and get really good, consistent results. I will need to check my imaging computer later for setting details. Off the top of my head: I use the Lum filter: 10s exp, and 7 samples…also smart focus is disabled.

That’s a lot of points. I’d reduce that to 7 and increase your steps per point to accommodate (about 2x your current value). Then you’d want to determine why you’re not getting to focus…my guess would be a backlash issue in your focuser.


I also think this can be au backlash issue, I use a JMI Crawford motorized with an heavy load usbfocus. I only can set the backlash in or out rather than both.