×

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

Bi-monthly release with minor bug fixes and improvements

*** Help needed to test changes to the Ekos Focus Module ***

  • Posts: 593
  • Thank you received: 276
The next round of upgrades to the Focus module are currently being tested. I'm hoping to merge the MR in the next week or two (assuming the testing goes well).

Those able to take "bleeding edge" changes will then be able to test the new code. You can either take the nightly builds or download the code and build it yourself.

I'm after a few courageous folks with an interest in Focus to help do some testing, suggest improvements, etc. The new version will be backward compatible so reverting to your current version of Kstars/Ekos will be possible at any time. You need to manage your environments. I'd like folks to do their current workflow to ensure that it still works and then try the new features that might be useful to them. Any issues and suggestions, just report them to me. I'll fix them (assuming they are related to my changes) and remerge the code. When things works this will be released formally in the usual manner as part of a stable release.

The changes are primarily to Linear 1 Pass unless stated otherwise. Here's a summary (in no particular order):
1. Optimised curve fitting . Should be faster and more accurate and includes outlier rejection.
2. Currently HFR is the only fitting "measure" available. The following have been added:
  • HFR Adj (adjusted HFR to compensate for star brightness vs background variation)
    FWHM
    Number stars (max at focus rather than a min)
    Fourier Power (alternative focus method not requiring star detection)
  • [/li]
3. Focus units can be displayed in pixels or arc-seconds.
4. Critical Focus Zone - a calculator with 3 different algorithms has been added
5. Focus Offset Utility to automatically build focus offsets.
6. Take flats at same focus point as lights has been fixed.
7. Focus Adviser. Still working on this but a tool to help with focus parameters (since there are now so many).
8. SEP parameters suggestions for focus. Keen to get some feedback on this.
9 . Adaptive focus to adapt the focuser position between Autofocus runs, aiming to keep optimum focus for each sub-frame. Adaptations for Temperature and Altitude are supported.
10. Adaptive focuser start . The starting position for an AF run can be filter and Adaptive Focus adjusted.
11. Focus walks added to control how the inward sweep of the AF process performs.
12. AF Overscan originally implemented in the Linear algorithm and then reused by Linear 1 Pass now extended to all focuser movements.

Here is the document with more detail on the changes (you can download this .pdf for easier reading)...

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



If you're interested in helping just let me know. Nothing to do until the MR gets merged and when that happens I'll let you know. This will be an informal process where folks can spend as much or as little time as they like. I'll be grateful for all feedback and it will be better for the product if we fix as many issues as possible before they are formally released.
The following user(s) said Thank You: Gonzothegreat, Len North
11 months 4 days ago #92377
Attachments:

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

  • Posts: 200
  • Thank you received: 28
John - I'd like to participate in testing. Thanks for your work on this!
The following user(s) said Thank You: John
11 months 4 days ago #92382

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

  • Posts: 460
  • Thank you received: 69
I'm in: although weather, alignment issues with the bleeding edge version, and my innate ability to make mistakes might complicate things. :)
The following user(s) said Thank You: John
11 months 3 days ago #92407

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

  • Posts: 398
  • Thank you received: 117
Items 9 & 10 (Adaptive Focus Control) are the subject of prior work that may be able to be leveraged if desired. A config file version was implemented, and focus log file changes were implemented/released. See the following post for info:

indilib.org/forum/ekos/7626-temperature-....html?start=36#67730

I've sent a PM to you in case you are interested in collaborating. I'd be happy to support your effort on those topics. CS Doug S.
11 months 2 days ago #92418

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

  • Posts: 593
  • Thank you received: 276
Thanks Doug, sounds great!

I've leveraged a lot of the development that's in the thread. I'm thinking of this as a basic release of adaptive focusing. Folks can still utilise the log file changes to build the database of temperature vs focus point. They'll have to use their own steam to turn that into a linear relationship of "num focus ticks" per degree.

This can then be entered in the Filter Settings popup. The Focus and Capture modules are now integrated to adapt the focuser position as temperature and altitude change between subframes. This can happen unattended.

Of course, much more could be done in future to better automate it. This is one area where I'm expecting a list of things to do in future releases.
11 months 2 days ago #92421

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

  • Posts: 398
  • Thank you received: 117
Hi John, I recommend considering a quadratic over the linear. A linear will get you the core of any particular season, but probably won't suffice to handle a shoulder season or multiple seasons. The work to add the quadratic isn't much, and folks who want a linear can have it by setting the squared term to zero. Just a thought....
11 months 2 days ago #92431

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

  • Posts: 593
  • Thank you received: 276
Hi Doug,

Thanks for the post. I did see from your data in the post you reference that the temperature data looks like it has a curve in it. The altitude data is a bit more random.

In future fitting a more complex curve would be possible providing I know the equation and its differentiable.

I would like to understand the physics behind this a bit more. I guess there are a couple of things going on with temperature:
1. Thermal expansion of the optical train. The telescope being the main component.
2. Refractive index changes of the optical components (e.g. lenses) vs air with temperature.

I don't know if you, or anyone else, is aware of any papers on this topic? Would be interesting to try and build a model.

As far as altitude is concerned I haven't thought much about it but presumably the effects could include:
1. Lensing effect of the atmosphere.
2. Gravitational effect on the optical train components esp. the telescope tube.

Again, if you or anyone else is aware of any papers on this that would be really helpful.
11 months 1 day ago #92436

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

  • Posts: 398
  • Thank you received: 117
I haven't searched for papers. I suspect that won't bear much fruit as both astronomical institutions I've previously worked for elected to go the empirical route, measuring and building their own quadratic temperature curves. So, I thought some "wisdom" of the last 2 years using the software I built might help. Take as much or as little as you like.

a. My focuser has tended to drift in counts over many months. This puts a bit of stress on new calculations of function slope, but definitely affects the offset (the b part of mx +b). Allowing users to adjust the offset while retaining the slope will allow for multiple instances of where adjustments are needed but the basic slope stays the same.
b. You'll need to factor both filter offsets, and different gear profiles. Filters should be "zero offset" relative if possible, otherwise things get complicated quickly.
c. The elevation residual data is pretty noisy (as you noticed), but there is a definite trend in there. You may want to allow disabling elevation residuals as an option.
d. I wrote an analysis function that looks at the log and calculates/fits a trendline function. I don't automatically enable this calculation, but rather report it for inspection. It's helpful, and people may (or may not) want to update the function based on the calculation. Sometimes, it's best to just see it but leave it be.
e. There are times during processing when it's important NOT to auto-seed the focuser. Auto adjust is good after a slew without manual adjust, but if manual adjust is done after the slew but before imaging, the manual start position should not be overridden.
f. I'm not sure if you're going to use a summing integrator or not, but I advise that route for multiple reasons.
It's going to take time and patience for users to characterize their gear. I put a warning in the log for instances when there aren't enough data points. It may be required to automate turning OFF auto adjustments until enough data is present to actually validate using the function. Otherwise, it could actually be worse!
11 months 11 hours ago #92465

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

  • Posts: 593
  • Thank you received: 276
Hi Doug,

Thanks very much for the insights, much appreciated.

a) Drift. Yes, this is a problem. At the moment folks will have to manage their own data set to determine the coefficients of temperature and altitude so this will have to be taken into account. Can't think of a way to automate a compensator for this off the top of my head.

b) Currently the coefficients can be set per filter (or the same number entered against each filter). Different profiles will be managed by the Optical Trains functionality that was added a while ago.

c) Altitude (or temperature) can be disabled by setting the coefficient to zero.

d) Currently I haven't done anything on this. Folks will have to do their own trendlines with Excel (or other) on their data.

e) The Adjust Start Pos which adapts the start position for an Autofocus run based on temperature / altitude changes since the last successful Autofocus run for that filter, can be switched on/off in real time as needed.

f) Not sure what you mean by "summing integrator" but focus adjustments for temperature and altitude changes are calculated separately and combined before moving the focuser. My assumption is that these two effects are orthogonal (no influence of one on the other). In the absence of an analytical model its difficult to do anything else.

Getting sensible data in order to calculate the coefficients of temperature and altitude will be tricky for most people, myself included. I think a reasonable way to start will be to:
1. Just consider temperature (switch off altitude).
2. Get a series of measurements of focus vs temperature across a session being careful to make sure the equipment has had a chance to reach thermal equilibrium before starting.
3. Calculate the basic coefficient of temperature.
4. Try Adaptive Focus with this "crude" setup and see if there is any improvement in star HFR/FWHM between Autofocus runs with Adaptive Focus vs without.
5. Another way of looking at this is to compare the number of ticks of focus compensation across a couple of degrees of temperature change (or what you might experience in say an hour of observing) with the Critical Focus Zone. If they are comparable then Adaptive Focus might be worthwhile; if the CFZ is much bigger than temperature movements then its probably not worth pursuing Adaptive Focus.
6. If it looks like Adaptive Focus could be useful, then collect more data to refine the temperature coefficient and consider looking into altitude.

Thanks again, Doug, for all the insights. I think with your experience of this topic, your input is very valuable.
10 months 4 weeks ago #92475

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

  • Posts: 398
  • Thank you received: 117
Hi John, It might be a good idea to look at the code I originally developed to see what you might learn from it. Here's the link:

invent.kde.org/dmsummers/kstars/-/commit...898eaca8e0dc9891582f

Note that the main section of code (focusCompensator.cpp) is collapsed by default due to its larger size. Just uncollapse. Hopefully a look will answer multiple questions. If it's still not clear what was going on, I'm happy to discuss. You can send me a PM or email to This email address is being protected from spambots. You need JavaScript enabled to view it.

Cheers, Doug
Last edit: 10 months 3 weeks ago by Doug S.
10 months 3 weeks ago #92531

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

  • Posts: 593
  • Thank you received: 276
Thanks for sharing this Doug, I'll take a look!
10 months 3 weeks ago #92536

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

  • Posts: 398
  • Thank you received: 117
If you're going to take a look at the code, I guess it would be helpful to have the config file that was used. Here's what the controls config looked like:

10 months 3 weeks ago #92538
Attachments:

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

Time to create page: 0.440 seconds