Auto Focus - Refocus Fail

Discussions, Bug Reports and Issues related to Beta versions of SharpCap
kaymann
Posts: 111
Joined: Thu Jun 16, 2022 2:59 pm
Location: https://azkayfes.blogspot.com/

Auto Focus - Refocus Fail

#1

Post by kaymann »

SC 4.1.10700 64 bit ZWO ASI533MC Pro 0°C

Last night 2023-06-11 & 12 I wanted to use autofocus. I started with a Bahtinov Mask and the focus assistant for the Bahtinov Mask worked wonderfully. I then wanted to auto-focus and went to the Focus Assistant and went to Multi-Star FWHM Measurement which indicated best focus in a different position. As the night cooled down (camera was cooled/kept to 0°C) I clicked on Automatic Refocus. This produced another result after a great deal of time... The seeing was very stable and steady and something did not look right so I went to 800% zoom and sure enough tiny donuts. So I manually (Scope Controls) focused to beautiful pinpoints in no time at all.

I must be doing something wrong as I found perfect focus at the manual 800% zoom in a fraction of the time it took to autofocus to get bad results...

Sensitivity 75
Max Brightness 95%
NR 0
Star Count 32
Average Score 5 frames
Both Suppress and Stretch were tried checked and unchecked
Scan Step Size was 50
Max Step Count 20
Backlash in Settings set to ASCOM handled
Samples to Collect 3
Move to best when complete
Use Smart Scanning
Prompt to Update on Refocus

C9.25, HyperStar, ASI533MC Pro, RAW16, 3008x3008, Binning 1, FITS, CGEM DX, PHD2 (working beautifully), ASTAP Plate Solved.

Randall
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Auto Focus - Refocus Fail

#2

Post by admin »

Hi Randall,

to me it sounds most likely that the measurement of the star sizes wasn't behaving itself for some reason in your setup. One thing to watch out for is low star counts (anything less than about 20). Refocus/autofocus will try to proceed, but if the stars are just on the edge of being detectable, the actual ones that get detected might change as the focus shifts and that can lead to issues.

Ideally, the best way to investigate this would be for you to send me some unprocessed FITS images captured both at best focus (as judged by you) and at 'best focus' (as judged by SharpCap) - I can then test those and see why the measurements are coming out oddly. Ideally a couple more at slightly different positions and a SharpCap log from the refocus scan that you have run when getting to the 'best focus as judged by SharpCap'. All of that info would give me a good chance of either finding any issue in SharpCap or advising you on any settings that might not be right.

cheers,

Robin
kaymann
Posts: 111
Joined: Thu Jun 16, 2022 2:59 pm
Location: https://azkayfes.blogspot.com/

Re: Auto Focus - Refocus Fail

#3

Post by kaymann »

FYI ASTAP can do analysis and my focused flat came out the best per ASTAP...

Logs are attached but FITS not allowed?

Randall
Attachments
Log_2023-06-12T08_03_54-5592.log
(134.57 KiB) Downloaded 25 times
Log_2023-06-11T22_24_24-14252.log
(761.07 KiB) Downloaded 27 times
Log_2023-06-11T22_07_08-8600.log
(135.57 KiB) Downloaded 25 times
Log_2023-06-11T20_11_01-14116.log
(142.14 KiB) Downloaded 26 times
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Auto Focus - Refocus Fail

#4

Post by admin »

Hi Randall,

yes, there's a size limit for attachments to avoid the backup requirements for the forums growing to silly amounts. For the FITS files the best thing to do is to upload to GoogleDrive/OneDrive/DropBox/etc and then post the sharing download link here in the forums.

I will review them along with the logs to see what I can work out.

cheers,

Robin
celkins
Posts: 130
Joined: Fri Apr 20, 2018 10:58 pm

Re: Auto Focus - Refocus Fail

#5

Post by celkins »

Robin,
I had an instance of refocus failing spectacularly a couple of nights ago: I always scan outwards, since I’m using a SCT, I clicked on auto focus, unusually (I usually control refocusing manually); after taking several frames, it determined that it was on the wrong side of focus (incorrectly, it was just quite some way out due to tube cooling), so it took a seek inwards, couldn’t get any improvement in focus, so took another big seek inwards (by now, obvious donuts to the eye), several frames, no improvement, seek inwards….
Try as I might, I couldn’t cancel the refocus operation… I ended up killing SC from task manager :cry:
kaymann
Posts: 111
Joined: Thu Jun 16, 2022 2:59 pm
Location: https://azkayfes.blogspot.com/

Re: Auto Focus - Refocus Fail

#6

Post by kaymann »

celkins wrote: Fri Jun 16, 2023 1:43 pm Robin,
I had an instance of refocus failing spectacularly a couple of nights ago: I always scan outwards, since I’m using a SCT, I clicked on auto focus, unusually (I usually control refocusing manually); after taking several frames, it determined that it was on the wrong side of focus (incorrectly, it was just quite some way out due to tube cooling), so it took a seek inwards, couldn’t get any improvement in focus, so took another big seek inwards (by now, obvious donuts to the eye), several frames, no improvement, seek inwards….
Try as I might, I couldn’t cancel the refocus operation… I ended up killing SC from task manager :cry:
Actually this describes my situation exactly as I clicked "in" for the first time as well and had to shut down as well (loosing too much dark sky time).

Robin, how do I get you the link to the flats without broadcasting.
Last edited by kaymann on Fri Jun 16, 2023 3:19 pm, edited 1 time in total.
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Auto Focus - Refocus Fail

#7

Post by admin »

Hi,

OK, I have seen the big backward focus jump once or twice too, so based on evidence I'm going to take the decision that the backwards move that you are seeing rarely works properly and causes more trouble than it solves, so I will disable it for now as an interim change.

As for the download link - there is a private message function here on the board, or you can use the 'contact us' email link at the bottom of the page.

cheers,

Robin
kaymann
Posts: 111
Joined: Thu Jun 16, 2022 2:59 pm
Location: https://azkayfes.blogspot.com/

Re: Auto Focus - Refocus Fail

#8

Post by kaymann »

Well I was challenged to a Lagoon Nebula Shootout so I fired up SC beta 700 and went to work - plate solve, check, center, check, sync, check, autofocus out, fail not found, auto moved itself way the heck in and fails x2, burning dark skies, kill Autofocus. Go to 800x zoom, manual focus until Now and best agreed (3.8). Take 210 frames result below:e
Smaller20230617-142126-M8 NGC6523 Siril-DT-Starless-Star.jpg
Smaller20230617-142126-M8 NGC6523 Siril-DT-Starless-Star.jpg (199.34 KiB) Viewed 554 times
SC correctly gives me the star width for some reason but cannot find the best focus and takes way too much time to fail...
As you can see focus never happened so I cannot send you comparison lights. Should I be purposely out of focus so SC can find focus easier. With it basically unchanged from the previous session we are only talking about temperature focus changes, However, here in the desert, temps at start can change drastically by mid and final lights.

I will definitely install Monday's Beta and give it one more go but at this time 800x with NOW and BEST showing me true best focus it seems easiest. Also Since plate solve, center and sync working great I am perplexed that auto-focus does not.

For my next attempt what would be the best default settings.

Thank you for your time and consideration.

Randall
Attachments
Log_2023-06-16T22_17_01-1308.log
(704.72 KiB) Downloaded 28 times
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Auto Focus - Refocus Fail

#9

Post by admin »

Hi Randall,

thanks for posting the log - I went through it and extracted the focus score measurements, which are interesting...

Code: Select all

Info   	22:33:21.039173	#1 	Measured focus score at position 17095.000 of 3.9259 +- 0.0163		
Info   	22:34:12.972654	#1 	Measured focus score at position 17145.000 of 4.0948 +- 0.0087		
Info   	22:35:05.354176	#1 	Measured focus score at position 17195.000 of 4.1741 +- 0.0123		
Info   	22:35:57.386028	#1 	Measured focus score at position 17245.000 of 4.0384 +- 0.0249		
Info   	22:36:49.649877	#1 	Measured focus score at position 17295.000 of 4.3551 +- 0.0666		
Info   	22:37:42.107171	#1 	Measured focus score at position 17345.000 of 4.5278 +- 0.0601		
Info   	22:38:34.111426	#1 	Measured focus score at position 17395.000 of 4.7734 +- 0.0105		
Info   	22:39:26.474778	#1 	Measured focus score at position 17445.000 of 4.9495 +- 0.0094		
<First jump back>
Info   	22:40:27.680634	#1 	Measured focus score at position 15595.000 of 6.4059 +- 0.0208		
Info   	22:41:19.541099	#1 	Measured focus score at position 15645.000 of 6.3777 +- 0.0414		
Info   	22:42:11.697728	#1 	Measured focus score at position 15695.000 of 6.3017 +- 0.0249		
Info   	22:43:04.115895	#1 	Measured focus score at position 15745.000 of 6.2342 +- 0.0310		
<second jump back>
Info   	22:44:04.589852	#1 	Measured focus score at position 14095.000 of 25.0000 +- 4.5934		
The first jump back looks almost justified as you can see that the first 8 readings from 17095 upwards are definitely getting worse as the focuser position increases. I am suspecting that there is something in the shape of the out-of-focus star images that is confusing the measurements in SharpCap, so it would be interesting to see some original images when you get a chance, both in focus and at the distance from best focus that the odd increase occurs.

The second jump back is unjustified - there was (still is) a bug that causes it, but since I have now disabled the jumping back code entirely, the existance of that bug doesn't matter any more unless I get around to re-enabling it in the future.

If you do have time to take some images at best focus and then at a few points away from best focus (say 250, 500, 750, 1000, 1250 off best focus) then I would be happy to look over those raw frames to see if I can find out how to improve things.

For the next attempt, I would initially leave the settings as is and see if the removal of the 'jump backward' code lets SharpCap continue to scan through the region where the focus score oddly increases to get to a point closer to focus where hopefully it starts decreasing. You may want to increase the step size from 50 to 100, since it seems that not much was going on in the inital 8 steps of 50.

cheers,

Robin
kaymann
Posts: 111
Joined: Thu Jun 16, 2022 2:59 pm
Location: https://azkayfes.blogspot.com/

Re: Auto Focus - Refocus Fail

#10

Post by kaymann »

admin wrote: Mon Jun 19, 2023 10:59 am Hi Randall,
...
...
If you do have time to take some images at best focus and then at a few points away from best focus (say 250, 500, 750, 1000, 1250 off best focus) then I would be happy to look over those raw frames to see if I can find out how to improve things.

For the next attempt, I would initially leave the settings as is and see if the removal of the 'jump backward' code lets SharpCap continue to scan through the region where the focus score oddly increases to get to a point closer to focus where hopefully it starts decreasing. You may want to increase the step size from 50 to 100, since it seems that not much was going on in the inital 8 steps of 50.

cheers,

Robin
Robin, first, I am using SC as my go to for all astrophotography (P-L-S-DSO). I really enjoy the fact the FITS are spit out unadulterated so I can ASTAP stack and Siril postprocess. SC lets me actually enjoy the capturing of Lights to see what is potentially waiting for me at the end of the road... Thank you for a fantastic tool to do all that. So I really really want this auto focus and refocus to work perfectly.
    • I will bump the steps to 100
    • I will try to send you frames (does SC keep any of the attempted focus frames that I can find to send to you or can I turn that debugging on?
    • Where do I start the auto focus process to ensure success- out of focus in, out of focus out, close as possible to focus, doesn't matter?
    Clouds predicted until Thursday could be a while...

    Randall
    Post Reply