Page 1 of 1

v4.1.11974 focus scan bug

Posted: Sat Mar 30, 2024 10:49 pm
by celkins
Robin,
as you'll see from the attached log, I had just started my usual focus routine - move -ve until obviously out of focus, initiate scan +ve : normally, this works without issue, but this one decided that something had gone wrong, then took off like a hoolie for zero, or so it appeared - I managed to pull it up at 2667 (which is rather less than its usual 32k range position)...

My other session found a decent focus, running in parallel...

Cheers,
Carl

Re: v4.1.11974 focus scan bug

Posted: Mon Apr 01, 2024 1:37 pm
by admin
Hi Carl,

thanks for the report. The key bit in the log that I think corresponds to your observation of the focuser running wild is this part, which marks the end of the scan

Code: Select all

Info   	22:33:46.442751	#1 	Measured focus score at position 31239.000 of 4.4031 +- 0.0617															in async Task SharpCap.FrameTransforms.Focus.Scanner.RunStepAsync(int i, CancellationToken cancellationToken)
Info   	22:33:46.442867	#1 	Data was 4.6019, 4.3720, 4.2354																							in async Task SharpCap.FrameTransforms.Focus.Scanner.RunStepAsync(int i, CancellationToken cancellationToken)
Info   	22:33:46.443065	#1 	After scan step 13, status is ImprovingFocus																			in void SharpCap.FrameTransforms.Focus.Scanner.LogFitStatus(int iStep, bool end)
Info   	22:33:46.443235	#1 	Current best fit is WrongShape with best at 27936.743728010202, confidence 0.9988399741941155, based on 6 points					in void SharpCap.FrameTransforms.Focus.Scanner.LogFitStatus(int iStep, bool end)
Debug  	22:33:46.444147	#1 	Notification (Status=Warning): Focuser scan in progress - step 14 of 17. Moving to position 31339						in void SharpCap.UI.NotificationViewModel.DisplayMessage(NotificationMessage message)
Debug  	22:34:16.603007	#1 	Notification (Status=Error): Aborting focuser scan because target position not reached within 30s						in void SharpCap.UI.NotificationViewModel.DisplayMessage(NotificationMessage message)
It has just done a measurement at position 31239 and requests a move to position 31339. However, you can see that the scan gets aborted because the move doesn't complete within 30 seconds. My educated guess is that the focuser/ASCOM driver glitched when trying to implement that last movement request from SharpCap and the focuser started moving towards zero. That took longer than 30s to complete, so SharpCap gave up waiting and ended the scan with an error.

I would check that you have the latest ASCOM driver and firmware for your focuser. If the ASCOM focuser driver has a logging option that was turned on then you could investigate the log to check what commands the focuser received from SharpCap - you could also consider leaving that option if it exists turned on to catch the log in case it happens again.

On the SharpCap side, I was only really expecting the 30s timeout to be hit if the focuser stops responding, but an unexpected move also triggers that error. I think I will add a 'Stop' command sent to the focuser at that point to at least halt movement if something like this happens again.

cheers,

Robin