I've refactored the Build Filter Offsets Utility introduced in 3.6.5
Recap: What's are Filter Offsets?
There are 3 ways to Autofocus in Ekos. Here, I've setup an example that covers each:
Attachment not found
1. Use Autofocus on the designated filter. In the example, Lum is configured like this. Whenever the Lum filter is selected in a sequence, Autofocus will be run on Lum.
2. Use Autofocus on a "lock" filter. In the example, Sii, Ha and Oiii are configured like this. Whenever Sii, Ha or Oiii are selected in a sequence, Autofocus will be run on Lum. When Autofocus completes (for example at 37273), Focus will apply the offset to go from Lum to, for example, Ha (in this case (-23 - 0) = -23 ticks. The focuser moves to 37273 - 23 = 37250 and Ha will again be selected in the filter wheel. This is useful in the case that its either difficult to focus a filter or it takes a long time because the exposure needed is long.
3. Don't use Autofocus but apply offsets on filter change. Red, Green and Blue have been setup like this. For example, when swapping from Red to Green, no Autofocus will be run and the focuser will from its current position (e.g. 37118) by the offset different between Red and Green. In this case, 4 - (-21) = 25 ticks. So the focuser moves to 37118 + 25 = 37143 and Green will be selected in the filter wheel. This can be useful to reduce the number of Autofocus runs in order to spend more time imaging and less time focusing.
So how do I setup Filter Offsets?
You can do it manually by running Autofocus several times and getting an average focus position for each filter. Then do the maths yourself to work out the offsets and enter these numbers into the Offsets column in the Filter Settings popup.
3.6.5 Introduced the Build Filter Offsets utility, launched from the Filter Settings popup by pressing the Build Offsets button. This helps to automate the process. See the Build Offsets section in the Focus section of the
Latest Build Filter Offsets
The utility has been refactored and some bugs fixed. In addition, now the utility takes advantage of Adaptive Focus. The reason for this is that running the utility on, for example, 7 filters with 5 Autofocus runs per filter will probably take longer than an hour. In this case, the environment factors that affect Focus such as temperature start coming into play. So, if you have already configured Adaptive Focus then this will be used to adjust each focus run for the environmental conditions in the first run in the utility to allow for better comparison of Autofocus results (an essential step in calculating Filter Offsets).
In this example, I've run Build Filter Offsets on all filters:
Here, the Adapt Focus box is checked and the results are adapted for temperature changes (I have this configured as 10 ticks per degree centigrade).
In order to help see what's happened, hover the mouse over an Autofocus result and an Adaptive Focus Explainer toolti[p will appear...
It shows the measured Autofocus result for that run (17994), adaptations for Temperature (0.3C change equal to 3 ticks) and Altitude (-1.6 degrees Alt but because I have configured 0 ticks per degree Alt, the Alt adaptation is zero). The deltas are between this AF run and the first one. Then it shows the resultant, adapted Autofocus result (17997). The Adapt Focus box can be toggled on and off and the grid will show the appropriate values which can then be saved into Filter Settings for future use.
In addition, the reference filter can be changed. It defaults to the first row and is indicated by an "*". In this case "Lum *". This can now be changed by double clicking another filter.
The code has just been merged (today) so is available to anyone interested in taking bleeding edge or daily updates. It will be in the next official Kstars/Ekos release.
I have an issue that just came up on the latest build: 2023-11-17T09:38:40Z running on Ubuntu.
During the Meridian flip, the camera module continues to capture, even if status shows slewing (During the flip) the capture module does not stop during the flip.
The other issue is if K-Stars uses the L Filter to do the align, when it does the Focus run, the filter stays on L (It was on the correct filter before the flip). I believe there is no logic in the program to let the focus module know the filter was changed during the alignment proceedure.
It focuses using the L filter instead of the capture filter, in this case "B".
It looks from the screenshots that you haven't successfully run Autofocus on Lum (data like Last AF Position should update after a successful Autofocus). Or maybe these were screenshots at the start and you subsequently ran Autofocus successfully?
Looks like when you swapped to the V filter it tried to move out by 60 steps (which makes sense if the previous filter was Lum). But then things hung.
If you have a log file could you post it please. I will try and recreate this problem later.
On the first issue (capturing during Meridian Flip) I'll see if any of the other developers can help.
On the second issue I'll see if I can reproduce it later. If you force a filter to be used in Align then what should happen (I think from memory) is that when Align completes, it should tell Filter Manager to return the filter to its previous value. It might be worth just double checking the Filter Settings popup to make sure you haven't got "B" locked to "L". Focus is quite dumb here, if an Autofocus is requested it uses the current filter unless that filter has a lock filter, in which case it changes to the lock filter, runs Autofocus, then returns the filter to the previous value.
I've run numerous autofocus runs on all of the filters, or do I need to run one while I'm in the filter offset window?
Tonight looks good for imaging so I'll run everything with logs turned on and try to do screen captures along the way to help diagnose issues. Thanks very much for creating this function it's hugely useful for me!!!
Something is wrong because these fields get updated automatically by Focus at the end of each successful Autofocus...
The fact that they appear to be showing initial values (prior to any Autofocus runs) is strange - I've not seen this before.
The FilterSettings dialog is just a view onto the data, whether its open or not when Autofocus runs won't matter.
Whether this is related to the issue you reported with Capture hanging I don't know but it implies that Focus can't communicate with the FilterManager to update it. Then Capture appears to hang whilst processing an adjustment of 60 ticks. This implies a problem communicating between Capture and Focus or the FilterManager.
Please turn on verbose logging for focus, capture and filters on your next run - hopefully we'll be able to figure out what's going on.
Here's my log of this evening. I autofocused on the target in Lum then ran a sequence of 30s LRGB filters. Each time it stopped at the focus change until I aborted it, reset the sequence and deleted the prior line. Each line appears to do the filter offset then just stop.
So 2 things:
1. I have an idea about why this bug is occurring. I haven't been able to reproduce it yet on the Sims but will keep trying,
2. The reason that the filter offsets isn't being updated after a successful Autofocus run is that you have a timer based focuser and there is code in place not to update it for these focusers. I had forgotten this. I don't think this will affect the bug causing point 1 though.