×

INDI Library v1.9.8 Released (29 Sep 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

New Focus Algorithm in Ekos

  • Posts: 112
  • Thank you received: 33

Replied by John on topic New Focus Algorithm in Ekos

The Linear 1 Pass focus algorithm has been merged into the code base and is now available in the nightly builds so if you are able to take the nightlies then you will be able to give it a go.

I have updated the document detailing the changes. It includes a section with suggestions on how to use it.

This browser does not support PDFs. Please download the PDF to view it: Download PDF



I'd be interested in any feedback. If you find a problem please send a log with "focus" messages enabled.
The following user(s) said Thank You: Spartacus, Bernd Limburg, Doug S, Juergen
3 months 2 weeks ago #83671
Attachments:

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

  • Posts: 380
  • Thank you received: 113

Replied by Doug S on topic New Focus Algorithm in Ekos

Nice work! It will be nice to see this included in the baseline. I've sent you a PM on another focus related subject that might be of interest. CS Doug
RASA11, Celestron CGX-L, ASI183mc Pro, 60mm guider + ASI290mm mini, ASI EAF focuser, PPB, Rpi4-4Gb+SSD, Powered USB3 hub, hardwire Ethernet.
3 months 2 weeks ago #83673

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

  • Posts: 790
  • Thank you received: 86
Does anyone know if this nightly update is available for Mac OSX as well?
EDIT: I just saw that it was indeed included in the latest Mac OSX nightly build. I will test it as soon we get a clear night.
It's monsoon season now here in NM. :(

iOptron CEM120 EC2 and CEM25P
Celestron C11 EdgeHD and William Optics Star71
ASI 1600MM Pro, ASI 462MC
Moonlight Litecrawler (C11) and Motorfocus (WOStar71)
LodeStar X2 and ZWO OAG
Nextdome, AAG Cloudwatcher
MacMini
Last edit: 3 months 2 weeks ago by Peter Kennett.
3 months 2 weeks ago #83677

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

  • Posts: 112
  • Thank you received: 33

Replied by John on topic New Focus Algorithm in Ekos

Hi Peter,

This link is helpful for Mac nightly builds:
indilib.org/forum/ekos/11408-announcing-...-on-macos.html#83666

As you're probably aware the nightlies include the latest versions of s/w which may / may not work. I spent a few minutes with Build #1560 which appears to work from an L1P perspective. The latest version Build #1563 has problems with memory allocation somewhere and won't take any subframes so is unusable. Sure this will be fixed quickly.
3 months 2 weeks ago #83680

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

  • Posts: 37
  • Thank you received: 4

Replied by Sergio on topic New Focus Algorithm in Ekos

Wow, this new algorithm fits perfectly what I was proposing here only 4 months ago (and you also had already in your mind by then) and even more that I didn't think of!! (different curves, weighting by HFR stdev, ...) Last night I gave it a try and it went quite smooth! I can afford to make focus exposures longer to get better SNR and even so, autofocus takes way less than before. Thanks so much for your effort, for me this is quite an improvement.

Playing with the parameters I occasionally ended up with a failed autofocus, that was quite expected as I pushed some of them. But although the log reflects the failure, it doesn't show why it failed:
[2022-06-25T23:46:39.443 CEST INFO ][     org.kde.kstars.ekos.focus] - "Linear autofocus algorithm aborted."
[2022-06-25T23:46:39.445 CEST INFO ][     org.kde.kstars.ekos.focus] - "Autofocus failed, moving back to initial focus position 5.448."
In this case, I guess it didn't meet the minimum R2 I configured, but I think it would be desirable if the failure reason gets logged.

Also, the Analyze tab didn't plot any HFR measurements in the graph, and "Iterations: 0" is shown under Details (in the log I see that this particular autofocus run took 9 HFR measurements).

Thanks again!
3 months 1 week ago #83833

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

  • Posts: 112
  • Thank you received: 33

Replied by John on topic New Focus Algorithm in Ekos

Thanks very much for the feedback Sergio. If you configure logging like this:


Then you'll get all the focus related messages. For an R2 failure you should get:
2022-06-26 12:49:09.983722+0100 kstars[11402:2349276] [org.kde.kstars.ekos.focus] "Linear Curve Fit check failed R2=0.999893 R2Limit=1 retrying..."

After the rerun you'll get something like this...
2022-06-26 12:50:00.620048+0100 kstars[11402:2349276] [org.kde.kstars.ekos.focus] "Linear Curve Fit check failed R2=0.997972 R2Limit=1, but continuing..."

I suppose your point is that it could be a bit more obvious as to why the rerun happened (as opposed to having to go hunt through a detailed log file). Good point, I'll have a look at this.

In the Analyze tab you should get a focus entry for each autofocus run. If the run is successful it should log all the datapoints. If it fails, it will log the fact that there was an autofocus run but not the datapoints. L1P just fits in with the existing Analyze workflow here. This is how it works for the existing focus algorithms.

If you post the log here I can take a more detailed look.
3 months 1 week ago #83835
Attachments:

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

  • Posts: 37
  • Thank you received: 4

Replied by Sergio on topic New Focus Algorithm in Ekos

Thanks John for your prompt answer. Truth is I even didn't think of enabling the debug logs... I was expecting these messages to appear in the status (bottom) panel of the Focus tab.
Yes, in the Analyze tab I do see the successful runs correctly. Sorry I didn't compare the failure case with the other algorithms, of course you're right.
Thanks for your time!
3 months 1 week ago #83837

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

  • Posts: 112
  • Thank you received: 33

Replied by John on topic New Focus Algorithm in Ekos

I've added the R2 fail messages to the status panel. I need to go through the other msgs and review where they are going. I don't know how long it will be before this gets into the nightly builds.
The following user(s) said Thank You: Jasem Mutlaq, Sergio
3 months 1 week ago #83842

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

  • Posts: 37
  • Thank you received: 4

Replied by Sergio on topic New Focus Algorithm in Ekos

No problem at all, the algorithm is totally useable as is.
Many thanks John!
3 months 1 week ago #83857

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

  • Posts: 931
  • Thank you received: 127
I used L1p yesterday for my (automated) observations. Looking at the analyze log, it always found a reasonable focus, even in bad conditions (I did have quite a lot of wind last night :( ). I strongly doubt any of the other algorithms would have found something better. For that, probably some machine learning would be needed (my brain BI would have picked slighly different values in some cases :cheer: )

All in all a very valuable addition!
openSUSE Tumbleweed KStars git INDI git
GPDX+EQMOD, CEM60EC, ASI2600/1600/290mini+EFW+EAF
The following user(s) said Thank You: John
3 months 1 week ago #83858

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

  • Posts: 188
  • Thank you received: 43

Replied by nou on topic New Focus Algorithm in Ekos

Just did quick test of this and it is really good addition.
The following user(s) said Thank You: John
3 months 6 days ago #83959

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

  • Posts: 112
  • Thank you received: 11
Just doing a first session with the Linear 1 pass and it works like a charm! First time I get really reproducible focus values and a focus run takes only half the time… Also, using weights for fitting is really a good thing to do!

Thanks John for the valuable extension!

CS, Bernd
254/1450 mm Newton, 130/730 mm APO, 70/336 mm APO, EQ6-R, ZWO EAF focusers, DeepSkyPro 2600c, ASI183MM, RPi4b 8GB, Bullseye 64bit
The following user(s) said Thank You: Jasem Mutlaq, John
3 months 5 days ago #83988

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

Time to create page: 1.028 seconds