I was running an imaging session last week with a SharpCap sequencer script, and it reported an unexpected problem with the autofocus during the running of this script that I do not understand. My sequence run had a loop that did the following:
LOOP 3 TIMES
SET EXPOSURE TO 2
SET GAIN TO 300
GUIDING STOP
AUTOFOCUS OFFSET 50 TO -40 STEP COUNT 9 BACKLASH 50
GUIDING START
SET EXPOSURE TO 300
SET GAIN TO 139
FRAMETYPE Light
#Keep this inner loop set to 4 for one hour of imaging
LOOP 4 TIMES
CAPTURE 1 FRAMES REQUIREGUIDING True
CAPTURE 1 FRAMES REQUIREGUIDING True
CAPTURE 1 FRAMES REQUIREGUIDING True
GUIDING DITHER NOW
END LOOP
END LOOP
I've used this a number of times successfully prior to this (and since then), and this loop executed fine the first 2 times through it on the night of 14 July. Then, when it was starting the third time through this loop, and it was in the process of making the third step (of the 9 requested) in the autofocus routine, I got this message in the log file:
Notification (Status=Error): 1 focus samples collected at 20367, but now focuser has unexpectedly moved to 20379.
This means that although the focuser was supposed to successively move inward to smaller steps each time, for some reason it appears that it moved outward unexpectedly, back to the last step that it had used. I have attached an excerpt from the log file during the time of this autofocus problem.
My question is: Is this just a one-time "glitch" that happened to me that I should ignore, or have others seen this happen, and if so, is there something to do to prevent this from happening again? It's not that I touched anything that may have caused this, because I was sleeping at the time. I did get up shortly after this, saw the issue that stopped the imaging session, and then I restarted the script, and the autofocus worked fine from then on, and I've used it successfully on several nights since then.
Any explanation for this unexpected autofocus error would be appreciated,
Rich
Unexpected error reported during autofocus
Unexpected error reported during autofocus
- Attachments
-
- AutoFocusError_071423.txt
- (31.13 KiB) Downloaded 67 times
- admin
- Site Admin
- Posts: 17558
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Unexpected error reported during autofocus
Hi Rich,
In one way it's easy to tell what happened here - SharpCap asked the focuser to move to 20367. Soon after that the focuser reported its position at 20367 and SharpCap captured a focus measurement. Then it seems the focuser changed position back to 20379 without SharpCap asking for it to happen. This now causes an error and causes the autofocus to stop (the previous behaviour was that SharpCap would wait forever in the vain hope that the value would change back to what it wanted).
The question is really 'why did the focuser position change (or seem to change) back'. I've checked through the code that handles the position changes in SharpCap and can't see any obvious way for the messages to get out of sync, but it's quite complicated, so I might have missed something. If there are other applications that are able to adjust the focuser then it's possible the command could have come from one of them, but odd that it moved back the exact number of steps to put it on the previous position.
You can turn on additional logging of 'focuser hardware communication' in the settings - that will make the log *much* bigger, but will include all the communications that SharpCap has with the ASCOM driver, so if it happens again we would be able to check if the ASCOM driver really went back to a different value, or if it was some glitch in SharpCap.
If it comes down to the ASCOM driver perhaps reporting a glitched value from time to time then I would have to update SharpCap to cope with that situation, so I'd be interested to know if it does happen again.
cheers,
Robin
In one way it's easy to tell what happened here - SharpCap asked the focuser to move to 20367. Soon after that the focuser reported its position at 20367 and SharpCap captured a focus measurement. Then it seems the focuser changed position back to 20379 without SharpCap asking for it to happen. This now causes an error and causes the autofocus to stop (the previous behaviour was that SharpCap would wait forever in the vain hope that the value would change back to what it wanted).
The question is really 'why did the focuser position change (or seem to change) back'. I've checked through the code that handles the position changes in SharpCap and can't see any obvious way for the messages to get out of sync, but it's quite complicated, so I might have missed something. If there are other applications that are able to adjust the focuser then it's possible the command could have come from one of them, but odd that it moved back the exact number of steps to put it on the previous position.
You can turn on additional logging of 'focuser hardware communication' in the settings - that will make the log *much* bigger, but will include all the communications that SharpCap has with the ASCOM driver, so if it happens again we would be able to check if the ASCOM driver really went back to a different value, or if it was some glitch in SharpCap.
If it comes down to the ASCOM driver perhaps reporting a glitched value from time to time then I would have to update SharpCap to cope with that situation, so I'd be interested to know if it does happen again.
cheers,
Robin
Re: Unexpected error reported during autofocus
Robin,
Thanks for looking into this. At the time of the problem, I had several programs open beside SharpCap, such as PHD2, Stellarium, PixInsight, and File Manager, but none of these were connected to the focuser, so I don't expect they were the source of the unexpected move. For now, I'll keep things the way they are. If this never happens again, I'll be a happy man. If it does happen again, I'll turn on the extra log info for all subsequent runs until it happens again. I'm relatively new to this aspect of SharpCap, but I have now run the autofocus routine over 50 times, and this problem has occurred just this one time. Now if we can just get rid of clouds and smoke in this region, I will test it some more.
Rich
Thanks for looking into this. At the time of the problem, I had several programs open beside SharpCap, such as PHD2, Stellarium, PixInsight, and File Manager, but none of these were connected to the focuser, so I don't expect they were the source of the unexpected move. For now, I'll keep things the way they are. If this never happens again, I'll be a happy man. If it does happen again, I'll turn on the extra log info for all subsequent runs until it happens again. I'm relatively new to this aspect of SharpCap, but I have now run the autofocus routine over 50 times, and this problem has occurred just this one time. Now if we can just get rid of clouds and smoke in this region, I will test it some more.
Rich