×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Ekos autofocus: drifts away on each failure

  • Posts: 50
  • Thank you received: 6
I have Celestron focus motor on Edge HD 8", connected to AVX mount via AUX port. Total focuser travel is approximately 40000 steps. But the range around the critical point when stars are detectable by autofocus algorithms is no more than a few hundreds. Like, if critical point is 25000, starting at 25100 is OK. 25200 is likely fine, unless the algorithm is going to jump to 25300 as a second step. Starting at 25500 is likely to fail miserably. Temperature drift is well within that good range, so theoretically there is no problem in maintaining good focus over long period of time.
I like how Linear algorithm works, when everything is good. I configure is with Initial Step 100, Max Step 20 or so. I get nice V-curve and pretty good focus. Other algorithms are not so good for me. They either fail in the middle of building V-curve, probably because of backlash. Or they end up with not so optimal position. Anyway, I was relatively successful with Iterative last night.
Now, when Linear algorithm builds some V-curve but cannot come up with a good conclusion it moves focus back where it started. It then restart (under scheduler) and usually succeeds. But if it fails on the very first shot (which is already 100 steps away from start!) it doesn't revert. If the cloud is big enough, after 20 attempts the start point drifts to +2000 and there is no chance autofocus would ever be able to recover. I am not sure what would happen if first few exposures are good but then start yielding garbage. Setting Initial Step lower makes it resilient to a few more failed attempts, but the V-curve become more like an 'l-curve', more prone to fail choosing the critical point. Anyway, an hour long cloud would surely kill autofocus even with lowest reasonable Initial Step.
Iterative algorithm does not move focus before taking first shot. If sky is bad by then it fails right there without unnecessary focus changes. I am not sure if it leaves mess when clouds comes in the middle of autofocus procedure.
My suggestion is to record focus position before starting autofocus and revert firmly to it unless focus algorithm succeeded.
3 years 4 months ago #63757

Please Log in or Create an account to join the conversation.

  • Posts: 398
  • Thank you received: 117
The condition you describe is one of several situations where autofocus gets off the "sweet spot", then struggles to recover (potentially impacting scheduling). This is exactly why I've suggested we need to think about temperature and elevation focus compensation to improve starting seed position for the autofocus loop. Just remembering the last successful position won't work for several situations. I don't want to hijack this thread; I'll just note another topic for those interested. Cheers, Doug

www.indilib.org/forum/ekos/7626-temperat...us-compensation.html
3 years 4 months ago #63771

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 6
This is an interesting idea too. At least your OTA shows pretty strong correlation between temperature, altitude and focus position. I am curious to see if mine has the same. I can't promise I will dedicate a whole night for gathering such data, because I only have so many nights for imaging...
Comparing to your idea, what I suggested is using last known good focus position as a seed. You showed that seed can be computed.
I guess, both ideas can be combined. Introduce the notion of focus position seed and have a bunch of alternative seeding strategies. One can be last known good position. Another can be your formula. By default, until user collects enough statistics, linear and quadratic coefficients can be zero, so the whole formula is effectively a constant seed position. Either way would be much better than starting from where previous crazy failed attempt left off :)
3 years 4 months ago #63773

Please Log in or Create an account to join the conversation.

  • Posts: 398
  • Thank you received: 117
Hi Const....no need to interrupt your observing at all! Just observe as you normally would, preferably over multiple nights even. Use autofocus whenever desired (as you normally would). The only thing you need to do is enable focus log debug. The output of those autofocus runs will be stored in the autofocus debug log (see the original post again for the details where these are stored). Build up a dataset over however much time you want. Whenever convenient, go back and snag those logs, combine the data, and then plot them. The only caveat is that you shouldn't mess with your focuser (like take it off the scope). If you do, make sure you index so you can get back to a consistent location. Simple!

On your other comments, we agree entirely.

Cheers, Doug
Last edit: 3 years 4 months ago by Doug S.
3 years 4 months ago #63775

Please Log in or Create an account to join the conversation.

  • Posts: 1221
  • Thank you received: 565
Konstantin,

There was a bug pre 3.5.0 where the Linear Algorithm wasn't reverting to its start position on failure (it was supposed to, but didn't).
That was fixed in 3.5.0, in fact just a couple weeks ago. See invent.kde.org/education/kstars/-/merge_requests/140

I'm not sure what software version you're running.
If you continue to see this with 3.5.0, or have other issues you'd like to discuss, please include a log, with debug logging enabled for focus
and I'd be happy to take a look.

Hy
3 years 4 months ago #63783

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 6
That is perfect timing! I just upgraded to 3.5.0 for my next outing. I tried it with simulators. It seems reverting properly after failures both right on the first shot and later in subsequent shots. Thanks :)
3 years 4 months ago #63784

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 6
Resetting focus position now works. But there is new, perhaps unrelated, issue: indilib.org/forum/ekos/8397-autofocus-is...g-start-request.html
3 years 4 months ago #64534

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301
This one is monitored in invent.kde.org/education/kstars/-/issues/53 I think.

-Eric
3 years 4 months ago #64577

Please Log in or Create an account to join the conversation.

Time to create page: 0.665 seconds