×

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

Bi-monthly release with minor bug fixes and improvements

Understanding autofocus routine

  • Posts: 41
  • Thank you received: 6
I'm still trying to maximize the autofocus-routine in Ekos.

I use a robofocus with a VMC200 telescope. The correct focus is around 9730 ticks, but it varies.
I have the options on: "auto select star", "sub frame", "dark frame", "max travel: 10000", "step: 50 ticks", "tolerance: 1%", "exposure: 1s".

Then I start the autofocus. He moves the focus a bit, up and down, but he never reaches the real optimal focus.

A V-curve is not really created. I just see some dots in a spread. Manually I have a best HVR around 1.2, but the routine never reaches that (best 1.8.). Result, my stars are slightly out of focus. When I follow the process in the fits-viewer then the star is every time a small donut, it never reaches the point of 1 lightdot. It seems to jump randomly from bigger donut to smaller donut, then again to bigger donut, mixed with other sizes of donut.

So, to optimize my parameters, I'm trying to understand what the routine does to calculate the optimal focus. What does the "tolerance" mean exactly? How does the routine builds the curve? If you select a high setting for the steps, say 100 or 200 ticks, how are you sure that the routine will return back to the good focus? Is it better to do larger exposure to be able to select a star in a star-poor field? Smaller exposures? At what point will the routine decide to try smaller step-sizes?
Last edit: 7 years 8 months ago by Meister Wolf.
7 years 8 months ago #9587

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

  • Posts: 456
  • Thank you received: 76
Is it possible you have some mechanical backlash in your focus drive train?
7 years 8 months ago #9590

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

I included focus logs in recent KStars update, so you can send me the kstars text log for your run along with the autofocus frames that were captured. I can try to analyze them and see where it went wrong. I'm currently working on a better star HFR calculation since some "donut" stars are not identified in the current star detection algorithm. This _could_ be the cause of your problems.

However, the algorithm works as follows:

Initial step is taken from the user supplied step. It should be sufficient enough to mark a change in HFR that is suitable for the algorithm to go on with. It varies from system to system, on my system when I am near optimal focus, I have "10" steps selected. After the first few steps, a slope is calculated and it tries to minimize the HFR value.

Once it passes to the other side of the V-Curve (i.e. HFR starts rising again), it reverses direction and further reduces step size in order to find the solution. A few years ago when I first wrote the algorithm, I tried to build a full V-Curve and then calculate the optimal point, like it's done on other focusing tools. But I found out that in practice, it's almost never the same point exactly again. Therefore, it works iteratively until it finds a point with X% (default 1%) difference from the best HFR it measured along the way. You can see that even if you're at your "correct focus" point, the HFR is never exactly the same value, there are always small variations.

At any rate, a difference of 0.6 HFR is huge, so there is something wrong going on here. Fortunately, the autofocus frames and logs are saved so this issue can be analyzed.
The following user(s) said Thank You: Hans
7 years 8 months ago #9591

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

  • Posts: 41
  • Thank you received: 6
Thanks for the explanation of the algorithm. Algorithm seems to be of good design, so it should work. Indeed, probably the main problem is detecting the donuts, but I can't really tell until problem occurs again.

I tried it again today, and he found good focus at 1.2 HVR. I'll follow it up when this problem occurs again. I changed tolerance to 0.8%. I'm imaging now and the whole process seems to work very good. :woohoo:
7 years 8 months ago #9608

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

Time to create page: 0.956 seconds