Autofocus with feedback (like centering)

Would love to see autofocus with full feedback,like the way centering works. I tried the current 2.5.1.17 version on my 8" Celestron Edge HD. I experimented with many different steps sizes, backlash values, etc over several days. Although I could get a “textbook” V shape, the focus was never as good as when using a Bahtinov mask. On my SCT, the mechanical backlash/hysteresis is not repeatable. If you have perfect focus at one value, it will be a different value when you try again a few seconds later. For a 30,000 center, this could be as much as +/- 50. Although only .2%, this is very noticeable in the images.

I don’t fully understand this request. Can you be more specific? I don’t understand the parallel to the centering process.

Sure…

When user starts the evening, they input (perfect focus) and (fine step) to “SuperFocus”.

(perfect focus) is the current focuser position for perfect focus with the Bahtinov mask.
(fine step) is the step size the user likes to use to achieve (perfect focus).

Now, when SuperFocus is called upon, the algorithm…

  1. Calculates HFR like is does now at (perfect focus).
  2. Increments by (fine step). Is HFR lower? If so, increment again. Is HFR higher? Backup and done.
  3. If HFR higher, go the opposite direction and repeat.

The key is small focus steps. Not the big steps the current algorithm uses. Big steps introduce non-linearities in SCTs and other scopes.

So not too much unlike the closed-loop Centering. (perfect focus) is the reference frame and (fine steps) is the differential.

“SuperFocus” can be enhanced in the future to increase or decrease (fine step) for faster and more precise convergence. But this may not be a great benefit (TBD).

I like this idea.[quote=“Kurious_George, post:3, topic:4262”]
Calculates HFR like is does now at (perfect focus).
Increments by (fine step). Is HFR lower? If so, increment again. Is HFR higher? Backup and done.
If HFR higher, go the opposite direction and repeat.
[/quote]

When I start the night and before I start the sequence I perform a autofocus using the focus control panel. I typically like doing 3 or 4 autofocus back to back to see if I getting similar results. Typically I see changes from run to run of 100 to maybe 300 steps, (my focuser has 7,000 steps and I typically start out close to 3,500, at the mid point). so a variation of 100 or 300 steps between runs is telling me I might not be at the best focus.

Maybe in the focus control panel allow for a check box to enable or disable a fine step differential focus feature like Kurious_George outlined that would kick in after the autofocus run. I think this feature would improve on the current SGPro autotocus to make it even more robust.

Just my thoughts,
mahaffm

@Kurious_George

Thanks. I understand what you are after now.

Also fair. I guess we would need more feedback that let us know if the current AF algorithms leave users in a position outside of their CFZ. Determining the smaller step size would be frustrating for some because of its sensitivity (another thing to train). This value would ideally be the minimum number of steps to produce a meaningful change in HFR. Unfortunately, HFR will vary even without moving the focuser due to camera SNR and environment. Definitely something to think about…

AF is already a very expensive feature for us… It consumes a great deal of support time and limits the number of new features we can produce because of it. I’m all for new stuff around AF, but at this point:

  • It must be necessary for a bunch of users (meaning that, regardless of tuning, the current implementation will never likely produce acceptable results)
  • It must not add more complexity to AF (and, as a result, the time required to support it)
1 Like

I do appreciate when the AF mechanism is upgradable with what the thread initiator suggests.

Due to unrepeatable flexure I am using with USB Focuser, I cannot achieve focus within CFZ when the focuser moves to the position it estimated in the V-curve, even when backlash is applied.

If SGP can check if the HFR is beyond the tolerance (e.g. x% of the min HFR in the V-curve), it continues to move in a small step in the same direction. If the HFR becomes larger, it reverse direction and move in a bigger step, clear the backlash, and to repeat the small step in the forward direction again.

Thank you for your consideration of the possible upgrade.

Determining the smaller step size would be frustrating for some because of its sensitivity (another thing to train). This value would ideally be the minimum number of steps to produce a meaningful change in HFR. Unfortunately, HFR will vary even without moving the focuser due to camera SNR and environment. Definitely something to think about…

Understood regarding ROI.

Users who are accustomed to using a Bahtinov mask likely know their (fine step). The logic can repeat the process 2-3 times and pick the average result to help filter SNR and environment.

I believe the benefits of this “SuperFocus” feedback loop are…

  1. It’s relatively immune to scope focus backlash and other hysteresis issues.
  2. The “closed loop” feedback is more robust and repeatable than the “open-loop” curve fitting.
  3. It has significant room for future enhancements. Examples…
    a. Dynamic optimization for (fine step) through observation of the current and prior HFR.
    b. Real-time graphic display of star focus for optional manual intervention.
    c. Potential for transparent continuous focus with little or no effect on guiding due to the small (fine step).
    d. Ability to warn the user when HFR is creeping up.

Just my 2-cents.

Have you guys considered just adding an external focuser/stepper? Ultimately we all know the limitations of a SCT for imaging. Instead of wasting resources trying to get software to model something non-linear, just remove the problem from the equation.

Focusers are cheap compared to the majority of our equipment. And, you could do things like add a rotator and make your equipment even more remote?

I agree there isn’t much point in adding elaborate code to focus a system that is not repeatable, but at the same time there is a known issue with the current autofocus routine that could be a problem for sct users: It is hard-coded to take the curve from high numbers to low. If that happens to correspond to a clockwise motion of the focuser knob, then the curves will likely not be repeatable and focus will shift even after you stop, because when focusing an sct you want to push the mirror up against gravity.

I have focused very well using a variety of software including my own, on C11, EdgeHD8, and EdgeHD11 - and they all worked extremely well and were quite repeatable - as long as you provide enough backlash compensation and make sure the focus curve is taken with the knob turning counter-clockwise.

I have also had situations where the curves were not repeatable - and that was due to something slipping in the stepper focus system. So make sure nothing is slipping.

A good thing to do is place a mark on the focuser knob so you can watch it rotate - and make sure it is going the right direction, and that after going up and down and removing backlash - it still comes back to the exact same place. If the knob orientation itself is not repeatable, then the focusing of the mirror won’t be, either.

I use about 1/2 turn of backlash compensation - which takes many seconds to unwind with robofocus.

When things are set up properly sct focusing with the knob works very well and there is no need to lose valuable backfocus by adding an additional focuser.

But if you find the autofocus curves turning the knob clockwise you will likely have a problem getting repeatable curves - and you may not be able to change settings with sgp or the focus driver to make it turn counter clockwise - because it is hard-coded in sgp. I had to rewire my stepper to make it go the right direction because of this limitation.

Frank

Hi Mads0100
I currently have two focusers on my setup. the Motofocus for moving the primary mirror and a Optec TCF-S Crayford focuser. The way I do my focusing is that I set the TCF-S steps at the mid point, 3,500 steps. I then do a manual focus using the Motofocus Once I obtain the best focus I can manually with the Motofocus I go the the SGPro Focus Control panel and perform, what I consider a more precise focus. I typically perform maybe 3 or 4 successive back to back focuses just as a sanity check. Typically I see the focus position change anywhere from 100 steps to 300. When Kurious_George suggested this proposal I thought it was a good idea for a possible improvment.

I am by no means an expert at this stuff and I am not a programmer. I look for people like yourself to chime in and if it doesn’t make sense or add much value and puts undo work load I’m good with whatever is decided. I was just agreeing with what Kurious_George proposed as maybe an opportunity for a possible improvement to the autofocus that SGPro currently has.

Kind Regards,
mahaffm

If the primary focusing did not seem optimal - make sure you were doing the autofocus as I describe above: The focus curve should be taken in the counter-clockwise direction, and there should be at least about 1/2 turn of the knob for backlash compensation. And, of course, the backlash compensation should only kick in when you need to turn the knob clockwise - which happens at the start of the autofocus curve.

Focusing by turning the knob ccw is advice given to any new owner of an sct, and it applies also for visual use with no stepper motor at all. Adding a motor doesn’t change this requirement - that the mirror should be pushed up against gravity in the final focusing movement.

Frank

1 Like

I found when I was starting that often I was beating my head against a wall when it came to certain systems. Focusing a primary mirror definitely seems like one of them based on the number of complaints I see.

I’m not a programmer either. But, I hate seeing Ken/Jared spend so much of their resources trying to fix something that is very complicated and could be fixed by spending a few extra bucks on the user’s part.

It’s up to them though :slight_smile:

Scts have no particular needs compared to other systems. They have a preferred direction to final focus and they require backlash compensation - just like most any system. There are multiple settings to specify and change what the meaning of in and out are - but there is no corresponding setting to set the direction of the focus curve.

The limitation on focus direction would apply to other systems as well but the impact may be more evident with an sct.

Frank

Based on the amount of time spent talking about this on here, we’ll just agree to disagree :). I get that theoretically it should be easy to solve; but it’s not. Even with the new focus routines.

Here’s an illustration of the request. Algorithm should avoid more than one (fine step) to the new (perfect focus)…