AF Data Points and Step Size

Hello,

I have recently added a focuser to my hardware and am learning how to use SGP to manage focusing. Weather is terrible here in the northwest USA so there seems to be plenty of time to practice.

“Auto Focus Date Points” is defined as: A value that defines the number of exposures to capture and measure to determine focus (data points). Data Points is used in conjunction with “Step Size. For specified 7 data points defined in conjunction with Step Size of 10, Auto Focus will initially rack the focuser out 30 steps, and then capture a data point at every 10 steps as it moves [back] in (7 times).

This is pretty confusing to me. I get that if I specify 7, SGP captures 7 images to calculate HFR for? The number of exposures (data points) is used in conjunction with step size doesn’t make sense either although it is an interesting link between the two. Why would auto focus rack the tube out 30 steps? And are these steps each as big as “step size”?

Can someone please clarify this?

Thanks

Farzad

Hi Farzad,

the subject is described in detail in the manual, and you recapitulated it well.

Let n be the number of data points and s the step size. SGP’s auto focus will assume that you are roughly in focus (e. g. with the aid of focus frames with a bahtinov mask), at FP (the rough focus point in absolute steps). SGP’s auto focus will then

  1. move the focuser OUT by ((n-1)/2 * s) steps and take a focus frame,
  2. repeat n times: move the focuser IN by s steps and take a focus frame.

In this way the range from FP + ((n-1)/2 *s) to FP - ((n-1)/2 *s) is covered in n steps.

In your example (n = 7, s = 10):

Why would auto focus rack the tube out 30 steps?

(7-1)/2 * 10 = 30

And are these steps each as big as “step size”?

Yes, s = 10, just as you fixed it.

The recommendation is to use an odd number for the number of data points (n). A very good value is 9, and there is no need to ever change this value. However, a proper step size depends on

  1. the Critical Focus Deviation (in µm) of your scope which is defined by the aperture ratio of your scope and
  2. the resolution (in µm/step) of your focuser.
    The proper step size has to be determined once for your set-up. If you know the CFZ of your scope and the resolution of your focuser, you can calculate a good starting point for the step size, see e. g.
    Nite Crawler FSQ 106 Autofocus - #8 by Chris - General - Main Sequence Software . However, the step size can easily be determined empirically as well.

Bernd

Bernd, thanks. The manual is indeed extensive on this and sometimes that can lead to confusion. I appreciate the clarification.

So we start with an initial HFR for the scene and we call it good. We then program SGP to monitor focus codition “periodically”. We tell SGP that when it is monitoring the focus, to do it over n focuser positions. SGP calculates how many motor steps it should move the focus tube IN-ward by multiplying (n-1)/2 by Step Size S. Step Size is a number that is associated with the hardware and optical train in use and is calculated by the user, and it represents the number of motor steps within SGP step. Assuming the step size for my equipment is S=10, and assuming I command SGP to take n=7 sample HFR shots, then SGP moves the focus tube in by [(7-1)/2]x10=30 10-steps=300 motor steps and takes its first focus shot and calculates its first HFR. SGP will then move the focus tube OUT-ward by 300 motor steps and does another HFR reading. SGP does this a total of n=7 times, then uses the weighted average of the smallest three HFR values and figures out where to move the focus tube - how many motor steps to move the tube In-wards, to achieve the best HFR (focus).

Is this correct?

Thanks

Not quite correct. I stay with your example (number of data points n = 7, step size s = 10). Say we are starting from an (approximate) in-focus-positon of 25000.

  1. The initial move is ((n-1)/2 * 10) = 30 motor steps OUT.
  2. The following steps are 10 motor steps (= the step size s) each IN.

The images that will be taken are at:

image focuser position
1 25030
2 25020
3 25010
4 25000 (this was the approximate in-focus-position at start)
5 24990
6 24980
7 24970

The step size s is the number of motor steps that SGP’s auto focus will move the focuser inward between the 7 data points. If the result is approved, the focuser subsequently will be moved to the evaluated new focus position.

Bernd

It seems I got my IN and OUT wrong.

The step size S is the number of [motor] steps calculated by the user as a function of the OTA and camera. This isa magical number at which a difference between HFRs can be noticeable. Let’s assume S=10 for a system.

The number of steps SGP uses to move the focuser from one “data point” (DP) to the next DP, the distance in motor steps between DP(n) and DP(n-1) is equal to the step size S=10.

The quantity of DPs is dictated by the user and based on whatever factor. It is best for DP to be an odd number so there is a middle data point. DPs are places where focusing tube will stop and SGP will take a focusing image and then calculate HFR for. For n=7 there are 7 DPs, and there are 7 HFRs.

Upon focus evaluation trigger as programmed by the user, SGP moves the focuser in one direction by the amount equal to [(n-1)/2] x S=30 motor steps. Once in that position, SGP will take a focus image and calculates an HFR(1). Then SGP begins rolling focusing tube in the opposite direction, stopping at delta step = S, taking a focus image and calculating HFR(2, 3, 4, 5, 6, 7).

After n=7 DPs have been imaged and HFR calculated for, then SGP takes the weighted median of three smallest HFR’s and uses those to decide what position to move the focusing tube into.

Do I get it?

I am also relatively new to SGP and changed focus units recently. While I found the formulas useful as starting points, I simply varied the steps until I obtained a reasonable “V” for most of my focus runs. Call it the “hunt and peck” method. First, I made sure that I had a FOV with plenty of stars that gave good HFR using frame and focus. (fields dominated by very bright stars never worked for me). The I applied the formula to obtain some reasonable starting point. Then I varied the step size until I was satisfied, doing a focus run after each change.

From a good focus (manual) and a decent field of stars, if your first focus change does not register on the graph, then you are probably too far out (too big a step size). Stop and SGP will return to your original focus setting where focus is good. Decrease step size by some reasonable value and run it again and adjust until you get a reasonable “V.” I image at F10, so sometimes I don;t get a sharp “V” if seeing is not great, but the results are usually reasonable. It takes a while, but it worked for me.

BTW, you will not get a good focus run in all fields, in my experience. Sometimes I get no HFR value for any star in the FOV when I know that my steps are reasonable and I interpret this as a FOV with stars that are not suitable and slew the scope to another field, focus, and then return to my target. The routine is not magic. And, you need to be close to focus before you start the focus run.

I have not yet enabled temperature compensation. Once enabled I suspect that the frame and focus routine I now use at the start of a run will not be needed. Working on that…

Ed

Ed, what you are doing makes sense and I will keep that in mind. I also realized recently that the formula for Step Size specified in the manual which is based on the difference of steps between the in-focus AND out of focus by a factor of 3~5 is also a much better way of easily figuring out what that step size should be.

To get the initial focus though, we may need to be looking at a field with a low magnitude subject in it to be able to use the Bahtinov filter, and then maybe turn around and find a field with a more uniform star magnitude to fine-tune.