×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

New Focus Algorithm in Ekos

  • Posts: 398
  • Thank you received: 117

Replied by Doug S on topic New Focus Algorithm in Ekos

Hi John, I wouldn't think collaboration is required. The calculator is interesting, but unnecessary. The formula from www.goldastro.com/goldfocus/ncfz.php should suffice:

CFZ = 0.00225 · θFWHM · √τ · A · f 2

CFZ - Critical Focus Zone (micrometers)
θFWHM - total seeing (arc seconds)
τ - focus tolerance as a percentage of total seeing (unitless)
A - telescope aperture (millimeters)
f - effective imaging system f/ratio (unitless)
0.00225 - constant (micrometers per arc second per millimeter)

Given a user estimate of seeing, and their acceptable tolerance (both of which could be defaulted), and capturing system info (or having user provide) for aperture & f/ratio, the CFZ pops out. Step size is then just a fit of CFZ on the translation of motor counts/revolution and focuser travel (mm->microns) as discussed previously.
1 year 10 months ago #82790

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

  • Posts: 145
  • Thank you received: 15
Hi,

any news on the one-pass linear algorithm? :)

Maybe a simple version with all manual parameters instead of automatically calculated step sizes will be fine as a first version? „MVA“ - minimum viable algorithm ;)

CS, Bernd
The following user(s) said Thank You: JuergenN
1 year 9 months ago #83359

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

  • Posts: 992
  • Thank you received: 155
Agree 100%. I hope there is some movement on this much needed autofocus system. Two years on, and I still cant use unattended autofocus with the current system.
1 year 9 months ago #83371

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

  • Posts: 593
  • Thank you received: 276

Replied by John on topic New Focus Algorithm in Ekos

I'm in the process of rewriting the code for the original release of Linear1Pass to fit in better with the kstars codebase. One of the more experienced developers is helping me.

The first release will have the existing functionality as per the document at the top of the thread.

I intend as a phase 2 to look at the topics raised in this thread along with some other things. My idea is to include a "helper" function to suggest values for some of the parameters, like step size. GoldAstro haven't as yet got back to me, but neither have I as yet chased them. It would be good to collaborate if they are interested but if not I can probably do something without them (obviously I wouldn't just take their algorithm without permission).

Since I'm not a professional developer there are no timescales for any of this. Its ready when its ready.
The following user(s) said Thank You: Tim, R Dan Nafe
1 year 9 months ago #83374

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

  • Posts: 1009
  • Thank you received: 133
Oh, an interesting thread that I somehow missed so far :ohmy:
So far, I'm using Linear, and get good results with it. I did, however', also notice that it has a slight tendency to overshoot a tad (by doing another step when I would say it's already at the best position). However, those last steps are (with the latest versions) a quarter of the initial step size.

I did have a look at this NCFZ article. Very informative. Maybe some input here from my side: I used the formula, and my setup and site details, to compute a value of 31μ. My step size of the EAF is 2.8μ, so that is 11 steps. For comparison, my initial step size is 20, i.e., 2 times the NCFZ. In good conditions that allows a very good estimate of the focus from the first pass. I don't think setting the initial step to 1 NCFZ (or even less) will improve things, and for less good conditions (variable seeing) the (only?) solution anyhow is to do more than one measurement per position, and average.

I do quite sometimes see that the first pass produces an (almost) perfect curve, and then also think 'now you should just go to the computed value, and be done'. Sometimes it's obvious (to me....) that the first pass isn't great, and the second one will improve things. So ideally I'd like to see a combination of both approaches, in finding some criterion on how well the first pass is, and then having an option in Linear to stop after that if it is good enough.
I'm not sure that always only doing one pass is as stable as the current Linear method.
My current setup will do the first pass in about 11 positions. It typically finishes the whole AF run in 15-20. More only in very variable conditions, but there I wouldn't trust a 1-pass run much, either. This means for me, I could save maybe 1 minute per AF run in good conditions. I would do rather 'pay' that as an insurance in case of bad conditions. But as you already mentioned in the first post, those that don't have issues with focus as it is can skip.
So my post isn't there to discourage the new method - the contrary! I just thought maybe my view on this is of some use :)
I do still wonder why the current Linear isn't working for some, and extremely well for others..... :blink:
1 year 9 months ago #83392

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

  • Posts: 145
  • Thank you received: 15
Hi,

John, thanks for the update! :)

Peter, that‘s indeed an interesting point. My observation is that I have a very smooth and plausible V curve in the 1st pass in most cases, and often a bad and jumpy 2nd pass curve. Never saw it the other way round, which is of course strange and doesn't make much sense, but that's the way it is. Maybe a mechanical issue of my Crayford focuser (backlash? slip?). Have to investigate more.

CS, Bernd
Last edit: 1 year 9 months ago by Bernd Limburg. Reason: typo
1 year 9 months ago #83395

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

  • Posts: 1009
  • Thank you received: 133
Well, 'jumpy' would rather point at BL (IMO). Slip (with a Crawford) is of course a possibility, but should rather produce a shifted second curve (unless there's a lot of random slip - but that would affect the first run, too). For BL, be sure to take care of (most of) it in the EAF driver, a possible small rest should be handled by the one-direction logic of the focus routine.
You do have the EAF on the main focus axis, not the (10:1) microfocus one, yes?
1 year 9 months ago #83396

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

  • Posts: 145
  • Thank you received: 15
The EAF is on the 1:1 axis, not the 10:1 axis, yes. Right now, I don't have BL compensation activated in the driver. But in the linear method, BL should only affect the one travel-back step between 1st and 2nd pass? (I thought...)
1 year 9 months ago #83398

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

  • Posts: 1009
  • Thank you received: 133
Yes, but if it is larger than what is done there, it might make the first few points of the second pass quite random.
It would also affect the first pass, but much less: Steps are twice as large, and usually you are still farther away from focus. But the second pass has half-sized steps (-> twice as many steps needed to compensate a remaining BL), and you are usually closer to focus.
1 year 9 months ago #83399

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

  • Posts: 225
  • Thank you received: 16

I could be wrong, but I thought that the backlash number is not used in the linear process. That is why it moves a large amount outward and then moves inward to eliminate backlash.

However, as I've written before, I'm not sure that the "outward/inward" move is effectively removing the backlash in my setup. I don't know how to prove it, but when EKOS sends the outward command it immediately sends an inward command. Based on simple observation, it feels like the focuser hasn't completed the outward move before receiving (and moving) inward. Therefore, the focuser is not at the expected position when it starts the second pass. Just my humble opinion. I wish there was just a brief pause between commands.

I also would really like to see a single pass process. The second pass never improves my focus point and often confuses the process, causing a redo.

Ron
1 year 9 months ago #83401

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

  • Posts: 1009
  • Thank you received: 133
Two (Edit: Three) things:
The Linear method does not depend on a backlash correction. It tries to overcome that by the first-out-then-in movement. But a BL correction in the driver of the focuser will not be deactivated by it, so it will just see a smaller (or non-existing) BL.

As for your issues, one thing might be to verify what is 'in' and what is 'out'. What actually counts is that the element that moves should move against gravity. For classical refractors and SCTs (etc.) with a focuser in the back that is easy.
With an SCT and the internal mirror focusing that gets reverted, as you have to end the move moving the mirror up, which will move the focus point away from the telescope. And with a Newton, it will depend on where the exit is positioned (and might then even change depending on pointing)

Finishing the move - as mentioned here, try to increase the polling time in the driver. If you set that to, e.g., 2000ms, there should be at least 2s between start of the first move and start of the second move. That would at least prove that (also) your focuser works as expected. Also - have you checked the INDI tab of your focuser? IIRC that one should always report that it has reached the requested position before it accepts new commands.

And of course I agree such a 1-pass is a good idea to help those having issues. It's just that I think most of those issues are not with the algorithm itself, but rather with the setup. And finding out what causes the problem is always a good idea - regardless how you're going to handle it :)
1 year 9 months ago #83403

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

  • Posts: 225
  • Thank you received: 16
Peter,

Thanks for the explanations!

Good to hear on the backlash... as you say, it shouldn't really matter with linear.

On focus with a SCT... I can understand the difficulty with the focusing mechanism. For me, it's all the more reason to keep it simple. First form a good curve on the first pass, then move out a large amount and back to that position.

On the polling time... This may be where I'm having issues. Mine is set at 1,000 ms (1 sec). Based on what I hear when it moves out and then moves in, it is nowhere near a 1 second delay. I'll need to check the messaging to see if it reports reaching the position. Next time, I'll try an exaggerated polling time (like 3,000) to see if I can discern a true delay.

Thanks again!

Ron
1 year 9 months ago #83404

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

Time to create page: 1.462 seconds