First experience with Quadratic Fit best focus evaluation method (SGP v.

As nobody seems to be willing to share her / his experience with the SGP’s new best focus evaluation method, Quadratic Fit, I will show my first data taken with SGP v3.1.0.295.

My equipment:
Takahashi FSQ 106 (no ED; focal length = 530 mm, aperture = 106 mm) with original Rack & Pinion focuser (no gear reduction), Robofocus stepping motor, Seletek Armadillo2 focuser controller,

The appended charts show the following:
chart_1.JPG: SGP’s AF window when the AF run is completed
chart_2.SVG: the very first focus curve of 12th Ocotber 2019 (HFR vs. fp) with 9 data points plus data of the validation frame
chart_3.SVG: number of stars vs. deviation from best focus [steps]
chart_4.SVG: temperature trend (focuser and ambient temperature vs. time)
chart_5.SVG: linear regression of best focus vs. temperature


The data were recorded in the night of 12th/13th October 2019, just one night before full moon. Moon rise was at 19:25. Target was M 33 with an angular distance of about 34.5° away from the moon. Sunset was at 19:46. At about 01:15 the until then clear sky began to overcast.

No pre-focusing with a Bahtinov mask or similar aid was performed. Instead the initial focus position was calculated from the linear function derived from prior capturing sessions. chart_2 shows the result of the very first AF run.

In the AF runs the step size was varied: 15 steps (AF runs at 21:23, 21:30 and 22:56), 10 steps (AF runs at 23:47) and 8 steps (AF runs at 01:19). With SGP’s old best focus evaluation method I generally used a step size of 25 steps, resulting in a large HFR ratio of about 8. However, sometimes this setting resulted in too low HFR value at the left and right edges os the AF run. With Quadratic Fit in the inspected range of the step size I don’t recognize an impact of step size on best focus, a step size of 15 seems to be appropriate for my setup.

Chart_3 shows the number of stars found for the AF runs vs. the deviation from best focus in steps. The shape of the curve is always found with my scope: the maximum number of stars is detected about 20 steps beside best focus. I don’t know whether this is typical for SGP’s star finding algorithm or whether this is specific for my telescope though.

Two different temperature measurement devices were used: one for measuring ambient temperature (a device that actually is intended for in-house usage) and an external temperature sensor, connected to the focuser controller, located at the scope tube near the objective cell and well shielded from wind.

In that night I captured 39 light frames (exposure time 5 min), extracted the focuser temperature from the FITS header and added the data to the temperature chart (chart_4; blue +: focuser/AF runs, green x: focuser/light frames, red diamonds: ambient). Temperature dropped only very slightly which is typical of my site (La Palma, pure maritime climate). The deviations between the to curves might be due to wind. I sat in the winter garden, so I just don’t know because I didn’t notice.

In chart_5 best focus values are plotted vs. temperature. During performing AF runs I triggered some manual reruns in order to check the reproducibility. The chart shows 12 AF runs, two data points are hidden because identical results were obtained (for both temperature and best focus) on the rerun. The reproducibility was very good.

Chart_5 also shows the linear regreeion of best focus vs. temperature. For my FSQ 106 a temperature coefficient of -10.2 steps/K is evaluated, this corresponds to -68 µm/K. Note that a negative temperature coefficient means that the focuser has to be moved INWARDS when temperature drops. The coefficient of determination R^2 is 0.9964 indicating an excellent correlation of measured best focus and temperature. Note that the range of deviations of best focus from the regression line is -0.5 to 0.7 steps!

I am very happy with this further development of SGP’s Auto Focus capability and want to encourage you to try this enhancement. I am curious about your experience.


1 Like

I tried the …300 version last night. It was a total flop with a 2127mm idk and optec tcfs-3 focuser. I was never able to get consistent focus, and many times the routine would just stop and the focus screen would disappear. I tried changing the # of steps and step size also. Sometimes it would work with the entire procedure going to completion, but only 50 % of the time.

I will try to get focus logs of the failures and they will be looked at.

If you’re having issues with the new focus please provide auto focus packs and a log so we can investigate.


<---- Using .300 build

Where is the ‘Quadratic Fit’ option, I can only find Half Flux and Full Width options


Quadratic Fit is used as best focus evaluation method (instead of linear regression) starting with v3.1.0.295. This was announced in the history of the beta versions

Thank you SGP team and the SGP users who were involved in suggesting and implementing the auto focus changes to SGP. I downloaded SGP v3.1.0.307 last night specifically to try the new auto focus system. I only had a limited time before clouds rolled in however my first impressions are very positive. Unfortunately I could only run two full AF tests:
Equipment: AR127 with stock focuser (Focal length = 826mm, aperture = 127mm), Rigel Sys n-step AF hardware, ASI1600mm pro.

AF Run Date Time Pos HFR Temp Filter

 1	 10/14/19	20:32:46	 16515	  1.75	     12	       Lum	           	
 2	 10/14/19	20:43:03	 16615	  1.93	     12	        Ha

Run 1: Quadratic Focus Successful with Fit Quality 98%
Run 2: Quadratic Focus Successful with Fit Quality 96%

As I was running the third AF test the clouds were coming in. SGP attempted to run the AF routine. It was smart enough to realize that it could not achieve a valid focus so after two more attempts the AF routine aborted and returned the focuser to my last valid focus position. This is fantastic! This is a great improvement - thank you for providing:
1, a method to recognize a failed run and
2, a controlled ending to an unsuccessful AF run.
Previously I have had failed AF runs (due to a passing cloud for example) completely ruin the subsequent AF attempts because it had pushed the focuser so far out of whack that it would never recover without manual intervention, thereby ruining the subsequent subs if the system was unattended. With the new system, even if the subs prior to the next AF attempt are ruined, at least I have confidence that the next AF run is starting from a good position.

This is all very encouraging and I look forward to testing the new AF routine in more detail not only with my AR127 but also my C9.25 when the weather cooperates.

Thank you and Best Regards


Chance would be a fine thing! I have had constant rain for the last three weeks. I’m paying for August/ September, or it might be the God of Equipment punishing me for buying a new camera.

Hope this helps Jared.

I only have two focus logs and they are the ones that failed. I switched back from version …300 to 3.03.169 after the failures. …169 works very well and my focus is pretty good. Using 13 data points and a step size of 75.

One of the other strange things that happen with 300 was that it wiped out my equipment profile and sequences. Everything had to be reentered in 169 again.

Here are the logs:sg_logfile_20191014183608.txt (411.6 KB) sg_logfile_20191014194049.txt (26.1 KB) sg_logfile_20191014194252.txt (20.9 KB) sg_logfile_20191014194353.txt (25.9 KB) sg_logfile_20191014194448.txt (20.9 KB) sg_logfile_20191014194538.txt (33.4 KB) sg_logfile_20191014195510.txt (769.2 KB)

Don’t know why, but I cannot get the AF files to upload here. Is there another way to send them to you?

The issue that Gunny had with v3.1.0.300 was the same as the one mentioned here: Filter Offsets not being applied correctly - V295 - Sequence Generator - Main Sequence Software (error message “Index was outside the bounds of the array.”). This has obviously been fixed in v


The enhancement to the final focus plot is nice, something I have been wanting for a long time.
I am referring to the focus details that are now showing up under the plot:
In this example
Auto focus is complete (24559; HFR 1.62)

This is really helpful. This color scheme of this example is from an earlier release.

The 307 release looks like this:
I think the earlier color scheme, like we have always had, is better. The dark background obscures the details of the quadratic curve.

I would also love to see filter and temperature and quality added to the summary line. It might look like this:
Auto focus complete (24559; HFR 1.62; Ha; 15.12C; 98%)
Auto focus complete (24559 HFR 1.62 Ha 15.12C 98%)

Adding the filter to the name of the image plus a unique number would be nice. It would allow all the focus images to be copied into one directory for easy perusal and analysis.

1 Like

I understand… for better or worse, this change comes at the request of many other users. I will look at increasing the contrast while keeping it dark.

Maybe a little less dark, more toward gray. Perhaps a brighter green.

Slightly off topic: I rarely, if ever, install new software this time of year since in all likelihood, Winter is Coming and I’ll be down for the count. But, in case we would catch a break, can I install a beta version and still be able to use my current, non-beta, or will the installation over-write my working program? My philosophy is if it ain’t broke, don’t fix it , and the current version of SGP definitely “ain’t broke!”


In most cases, the to this would be yes. In this case though, some of the more important underlying elements have changed. In order to work properly all of your data must undergo an automatic, one time migration to the new formats. We do absolutely make copies of the old data before we migrate, but getting back to a normal 3.0 setup would be more complex than just simply re-installing and any changes to settings, sequences or profiles in 3.1 would not make it back to 3.0 (even if that thing you modified exists in 3.0)

While I agree I am more of the opinion that a lot of things in 3.0 are less than ideal. SGPro 3.1 is shaping up to be a pretty big release with tons of improvements.

Here’s a log from my primary scope,which I upgraded to 307 last night. The details are:
RC8" Carbon with a 2,5 inch rack and pinion focuser and a Primalucelab Sesto Senso motor. Focal length 1080mm due to the use of a reducer. I use the Luminance filter to do the focusing.
I live close to a city with lots of light pollution.

The file dated 16.10. is one using SGP 169, the one dated 17.10. is after i switched to 307.

sg_logfile_20191016183719.txt (630.5 KB)
Microsoft OneDrive - Access files anywhere. Create docs with free Office Online. (seems this file is too large to upload, here’s the onedrive link)

Hi Allen,

it would be helpful if you described shortly what experience you made: new issues, improvements?


Thanks Bernd.
Basically, I’m happy with the result. Worked straight away.

I used the SGP Image Grader to analyse the data from yesterday and compare it some data from a week ago. The old data displayed an average HFR of 1,32 in comparison to the average of 1,48 yesterday (the weather was better yesterday, same target though.). Not sure if this means that the old method delivered sharper results and I know that the comparison is very rudimentary and statistically irrelevant. So, I’ll hold off with a judgement, till I have more experience with the new method and have processed some of the data.

Just wanted to add; my impression in the preliminary discussions was that the quadratic method would make it easier to auto focus, even if the initial focus is a little off the ideal focus point. To me that did not seem to be the case yesterday.I still had to “manually” focus to close to the ideal focus point (as was necessary with the previous method) before the auto focus would deliver decent results.

This is true. The new method only deals with how to determine the best focus based on the image curve that has just been made. Has nothing to do with where the focuser is positioned prior to running the focus routine. Initial positioning is a new feature that has been proposed.