Another autofocus fail
Posted: Sun Aug 06, 2023 5:50 pm
This post may be pretty similar to the recent one posted by mfs4n.
I’ve been very happy with the performance of the focus tool in SharpCap recently, that is, up until about 11:55 pm last night. I was running a sequence script, and it was to do ~3 hours of imaging, with a refocus every hour. It was performing the last refocus of the night, but then “something happened”. I was asleep when this happened, but my alarm got me up an hour later at 1 am so that I could make sure all worked well, shut everything down, and perhaps start WBPP going in PI. I immediately saw that the imaging session stopped abruptly one hour early because the refocus did not work. The attached .jpg file shows the results of the disastrous refocus. I’ve also attached the portion of the SharpCap log file that deals with this refocus attempt.
Here’s what this looks like to me: The refocus was to perform 9 steps. It did that, and it looks to me like that produced a rather good-looking parabola, the kind that should lead to a good focus point. You can see the parabola on the right side of the graph centered on the vertical dashed line. I plotted the FWHM values from the SharpCap log file for the first 9 steps on graph paper, too (not shown), and that showed a parabola. However, after taking these 9 steps, there is then this message in the SharpCap log file:
Notification (Status=Warning): Focus scan did not contain enough data before best focus point. Moving back to position 6739 and continuing scan.
At this point, all was lost, and so I have a number of questions. First, why did the algorithm not think there was “enough data” and start searching for more? The parabola looked rather good to me with the initial 9 points. Second, why did the SharpCap algorithm keep going on and on when it was very clear a good focus was not going to be found? Third, why was SharpCap giving values of ~4 for the FWHM when the system was horribly out of focus? I didn’t make a screen capture of what the stars looked like on the screen after the last calculation was done, but they were gigantic, far out of focus.
Based on what I’ve been seeing, here are my thoughts:
(1) The SharpCap focus tool can produce a parabola and a focus point given the 9 steps I ask for a large percentage of the time.
(2) If the SharpCap focus tool has to extend to the left one or two more steps beyond the 9 I ask for, it will generate a parabola and a good focus point.
(3) If the SharpCap focus tool decides to backtrack to somewhere near the middle of my 9 steps to try to find a focus, all is lost. In my somewhat limited experience, I don’t think I’ve ever seen this succeed. I also don’t know why in some cases, such as this one from last night, it even has to do this. Perhaps some refinement or relaxation is needed in how the data from the initial steps is used to define a parabola. Also, and this is something I saw someone else allude to, is that in cases like this where the algorithm backtracks to refine the solution, until this is remedied, it may be best instead of doing that, to just to have SharpCap immediately stop the refocus algorithm, return to the original focus point, and let the imaging script continue from there. Another option would be to have the algorithm repeat the initial 9 steps that were asked for (instead of trying to refine the original), with the hope that it would succeed this second time. If not, bail out and let the imaging continue.
BTW, I’m still using SharpCap 4.1.10872 (beta).
Rich
I’ve been very happy with the performance of the focus tool in SharpCap recently, that is, up until about 11:55 pm last night. I was running a sequence script, and it was to do ~3 hours of imaging, with a refocus every hour. It was performing the last refocus of the night, but then “something happened”. I was asleep when this happened, but my alarm got me up an hour later at 1 am so that I could make sure all worked well, shut everything down, and perhaps start WBPP going in PI. I immediately saw that the imaging session stopped abruptly one hour early because the refocus did not work. The attached .jpg file shows the results of the disastrous refocus. I’ve also attached the portion of the SharpCap log file that deals with this refocus attempt.
Here’s what this looks like to me: The refocus was to perform 9 steps. It did that, and it looks to me like that produced a rather good-looking parabola, the kind that should lead to a good focus point. You can see the parabola on the right side of the graph centered on the vertical dashed line. I plotted the FWHM values from the SharpCap log file for the first 9 steps on graph paper, too (not shown), and that showed a parabola. However, after taking these 9 steps, there is then this message in the SharpCap log file:
Notification (Status=Warning): Focus scan did not contain enough data before best focus point. Moving back to position 6739 and continuing scan.
At this point, all was lost, and so I have a number of questions. First, why did the algorithm not think there was “enough data” and start searching for more? The parabola looked rather good to me with the initial 9 points. Second, why did the SharpCap algorithm keep going on and on when it was very clear a good focus was not going to be found? Third, why was SharpCap giving values of ~4 for the FWHM when the system was horribly out of focus? I didn’t make a screen capture of what the stars looked like on the screen after the last calculation was done, but they were gigantic, far out of focus.
Based on what I’ve been seeing, here are my thoughts:
(1) The SharpCap focus tool can produce a parabola and a focus point given the 9 steps I ask for a large percentage of the time.
(2) If the SharpCap focus tool has to extend to the left one or two more steps beyond the 9 I ask for, it will generate a parabola and a good focus point.
(3) If the SharpCap focus tool decides to backtrack to somewhere near the middle of my 9 steps to try to find a focus, all is lost. In my somewhat limited experience, I don’t think I’ve ever seen this succeed. I also don’t know why in some cases, such as this one from last night, it even has to do this. Perhaps some refinement or relaxation is needed in how the data from the initial steps is used to define a parabola. Also, and this is something I saw someone else allude to, is that in cases like this where the algorithm backtracks to refine the solution, until this is remedied, it may be best instead of doing that, to just to have SharpCap immediately stop the refocus algorithm, return to the original focus point, and let the imaging script continue from there. Another option would be to have the algorithm repeat the initial 9 steps that were asked for (instead of trying to refine the original), with the hope that it would succeed this second time. If not, bail out and let the imaging continue.
BTW, I’m still using SharpCap 4.1.10872 (beta).
Rich