The sequencer subroutine below gets called about a dozen times a night during a series of occultation observations. The first time it is called the autofocus plot showing the individual focus points and fit (when it becomes available) appear normally and the vertical scale adjusts automatically. On every subsequent call the plot remains blank and there are no vertical scale values shown on the left hand side. I've attached a complete example of a sequence that calls this focus subroutine. Thanks, Mike.
DEF SUB AFOCUS
DISPLAY STRETCH AUTO
IGNORE ERRORS FROM ONERROR RUN ""
AUTOFOCUS OFFSET -9000 to 9000 STEP COUNT 14 BACKLASH 0
END IGNORE ERRORS
END SUB
Issue with autofocus display scaling during sequence
Issue with autofocus display scaling during sequence
- Attachments
-
- Auto432x1231.scs
- (9.88 KiB) Downloaded 346 times
- admin
- Site Admin
- Posts: 17609
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Issue with autofocus display scaling during sequence
Hi,
interesting - I tried to make a simple sequence (just repeated calls to the autofocus subroutine) to see if that showed the effect, but sadly it didn't. Unfortunately I can't realistically run through your main sequence that you shared to try to test this - there are too many dependencies on your equipment set up and just too much going on for me to keep track of what is important and what is not. If you can create a minimal sequence that shows the problem that would be really helpful as it would be something I could then try.
Just to try to collect some more info - in the subsequent focus operations where you don't see any graph... Are they actually succeeding and finding the best focus (just with no graph), or are they failing for some reason? I can see that they are wrapped in an ignore error so that a failure would just be ignored and allow your main sequence to continue.
Another point of interest is if you are accessing the PC by some sort of remote desktop tool? Sometimes that can lead to user interface glitches that don't show if you are using the computer with a keyboard/mouse/monitor directly attached. Usually the Microsoft remote desktop is the best remote access tool and shows the least problems, but that's not always the case.
cheers,
Robin
interesting - I tried to make a simple sequence (just repeated calls to the autofocus subroutine) to see if that showed the effect, but sadly it didn't. Unfortunately I can't realistically run through your main sequence that you shared to try to test this - there are too many dependencies on your equipment set up and just too much going on for me to keep track of what is important and what is not. If you can create a minimal sequence that shows the problem that would be really helpful as it would be something I could then try.
Just to try to collect some more info - in the subsequent focus operations where you don't see any graph... Are they actually succeeding and finding the best focus (just with no graph), or are they failing for some reason? I can see that they are wrapped in an ignore error so that a failure would just be ignored and allow your main sequence to continue.
Another point of interest is if you are accessing the PC by some sort of remote desktop tool? Sometimes that can lead to user interface glitches that don't show if you are using the computer with a keyboard/mouse/monitor directly attached. Usually the Microsoft remote desktop is the best remote access tool and shows the least problems, but that's not always the case.
cheers,
Robin
Re: Issue with autofocus display scaling during sequence
Thanks. I'll see what I can do to reproduce it in a simpler way. In answer to your questions
- the focus runs properly, finds a solution, and drives the focus to the new correct value
- I do use a remote desktop to run the system (NoMachine). I should be able to do a daytime dummy run using a real monitor and let you know if it makes any difference.
Everything used to work fine. I'd see a real focus curve for every instance. At some point it stopped working for anything but the first focus run. I just lived with it, but thought I would ask, so, unfortunately I can't tie it to an update of either Sharpcap or NoMachine.
Happy New Year from 2025...
Mike.
- the focus runs properly, finds a solution, and drives the focus to the new correct value
- I do use a remote desktop to run the system (NoMachine). I should be able to do a daytime dummy run using a real monitor and let you know if it makes any difference.
Everything used to work fine. I'd see a real focus curve for every instance. At some point it stopped working for anything but the first focus run. I just lived with it, but thought I would ask, so, unfortunately I can't tie it to an update of either Sharpcap or NoMachine.
Happy New Year from 2025...
Mike.
- admin
- Site Admin
- Posts: 17609
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Issue with autofocus display scaling during sequence
Hi,
OK, so it's good to hear that the focus is actually happening rather than just nothing going on at all.
It's probably worth checking the option in the first page of the settings to use graphics card acceleration. SharpCap can auto-disable that if it encounters a problem that looks like it might be due to issues with the accelerated operation. If it is unticked then that may have happened and maybe that ties in with it stopping working. Certainly worth trying both ways as this is the sort of issue that might be resolved by adjusting this setting. It's also probably worth making sure that your graphics card drivers are up to date if you are using the accelerated option.
cheers,
Robin
OK, so it's good to hear that the focus is actually happening rather than just nothing going on at all.
It's probably worth checking the option in the first page of the settings to use graphics card acceleration. SharpCap can auto-disable that if it encounters a problem that looks like it might be due to issues with the accelerated operation. If it is unticked then that may have happened and maybe that ties in with it stopping working. Certainly worth trying both ways as this is the sort of issue that might be resolved by adjusting this setting. It's also probably worth making sure that your graphics card drivers are up to date if you are using the accelerated option.
cheers,
Robin
Re: Issue with autofocus display scaling during sequence
I thought I would provide an update after trying a number of things, including your suggestions. Bottom line... I think the behavior is largely unchanged. The first focus of the night in a sequence produces a nice plot and every subsequent focus is a blank. As has happed before, every once in a while it works, plotting the focus curve on a proper scale on every focus all night. The one piece of information I can add is whenever I request a focus scan manually there's no question that I will see a clean plot, but start that sequence running and starting with the second focus... nothing. It's not worth pursuing if nobody else is concerned since it doesn't really slow me down, it's just an annoyance since the focus itself works fine and most of the time I'm not supervising the system anyway.
But... while on the subject of autofocus I had one other question. Occasionally, seeming a little more often recently, I'll get a nice clean focus scan, and during the scan I see a great fit, but then the last few points - which can be a bit bizarre because I do wide focus scans where the final points are significant donuts and your FWHM evaluation can give abnormally low values - the autofocus routine will throw the good fit out just when it is reaching the finish line. To the eye and brain there's no question there's a good focus solution awaiting, but the program decides otherwise and defaults to the old focus. I do these wide scans because I can get thermal drift of my focus that can be significant so I want to make sure I cover enough ground to get some points on either side of the minimum. In the meantime I've narrowed my focus range a bit so there are fewer (hopefully, if I don't start too far off center) bad points to confuse the fit. I thought I would bring it up in case there was a good solution. I've attached a log for one of the failed, but otherwise good, focus scans, a couple of images showing how focus determination breaks up at extreme focus, and one of the focus plots that I could grab that resulted in a failure. Thanks.
But... while on the subject of autofocus I had one other question. Occasionally, seeming a little more often recently, I'll get a nice clean focus scan, and during the scan I see a great fit, but then the last few points - which can be a bit bizarre because I do wide focus scans where the final points are significant donuts and your FWHM evaluation can give abnormally low values - the autofocus routine will throw the good fit out just when it is reaching the finish line. To the eye and brain there's no question there's a good focus solution awaiting, but the program decides otherwise and defaults to the old focus. I do these wide scans because I can get thermal drift of my focus that can be significant so I want to make sure I cover enough ground to get some points on either side of the minimum. In the meantime I've narrowed my focus range a bit so there are fewer (hopefully, if I don't start too far off center) bad points to confuse the fit. I thought I would bring it up in case there was a good solution. I've attached a log for one of the failed, but otherwise good, focus scans, a couple of images showing how focus determination breaks up at extreme focus, and one of the focus plots that I could grab that resulted in a failure. Thanks.
- Attachments
-
- Screenshot 2026-02-14 at 18.42.11.jpg (130.11 KiB) Viewed 1147 times
-
- Screenshot 2026-02-15 at 18.26.36.jpg (137.79 KiB) Viewed 1147 times
-
- Screenshot 2026-02-15 at 18.27.17.jpg (197.73 KiB) Viewed 1147 times
-
- failed_focus_20260305.txt
- (58.41 KiB) Downloaded 2 times
- admin
- Site Admin
- Posts: 17609
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Issue with autofocus display scaling during sequence
Hi,
thanks for coming back with the screenshots and log - that sort of thing really helps to understand what is going on.
I will need to review your log in a bit more detail - it's odd as at the end it lists the data points used and I would have expected them to be in either descending or ascending order (depending on your focus scan direction), but they are not. Odd.
I think the drop off at the extremes of the curve shown in the screenshot is a result of the stars becoming hollow as you get further from focus - that is not as well handled as solid star shapes by the FWHM measuring code, so in this case narrowing your scan range may well help (keep the same number of steps but reduce the distance moved at each step a bit). However, SharpCap is supposed to be able to ignore those edge points if they mess up an otherwise good fit. Unfortunately the log fragment that you included doesn't look like it matches the screenshot - a different scan I think, so I can't test the values from the graph shown in the screenshot to see why the curve is not detected in that case.
One thing to try is to press the little options button in the focus scan are (right hand side of graph) and tick the box for 'V shaped' curve detection. That makes SharpCap check for both U and V shaped focus curves, and can help with graphs like the one shown below.
cheers,
Robin
thanks for coming back with the screenshots and log - that sort of thing really helps to understand what is going on.
I will need to review your log in a bit more detail - it's odd as at the end it lists the data points used and I would have expected them to be in either descending or ascending order (depending on your focus scan direction), but they are not. Odd.
I think the drop off at the extremes of the curve shown in the screenshot is a result of the stars becoming hollow as you get further from focus - that is not as well handled as solid star shapes by the FWHM measuring code, so in this case narrowing your scan range may well help (keep the same number of steps but reduce the distance moved at each step a bit). However, SharpCap is supposed to be able to ignore those edge points if they mess up an otherwise good fit. Unfortunately the log fragment that you included doesn't look like it matches the screenshot - a different scan I think, so I can't test the values from the graph shown in the screenshot to see why the curve is not detected in that case.
One thing to try is to press the little options button in the focus scan are (right hand side of graph) and tick the box for 'V shaped' curve detection. That makes SharpCap check for both U and V shaped focus curves, and can help with graphs like the one shown below.
cheers,
Robin