Automatic refocus with ZWO EAF

Discussion of using SharpCap for Deep Sky Imaging
Candieman
Posts: 37
Joined: Thu Nov 29, 2018 6:29 pm

Automatic refocus with ZWO EAF

#1

Post by Candieman »

I just got a ZWO EAF, so I am a complete novice in the area of autofocusing. I’ve read other’s posts regarding automatic refocus within SharpCap and so I installed my EAF on my C925 EdgeHD and dared to test it last night using the SharpCap Automatic Refocus tool. Being the first time, I got somewhat confusing and discouraging results. Here’s a screenshot showing one sample result:
autofocusresult.070323.JPG
autofocusresult.070323.JPG (657.46 KiB) Viewed 11381 times

I’ve got a million other questions that I hope to find answers to myself over the next few nights, but let me ask this one: Can someone tell me why SharpCap couldn’t find a good focus point with this curve? It looks like there’s one to me. The original scan was to end at 532416, but SharpCap extended this to 532716. It looks like maybe it didn’t take those extra points into account. Why not? Also, on those relatively rare occasions when I did get a good focus with this tool, I immediately reran the automatic refocus tool and it could NOT come up with a good focus, even though it did just minutes ago. Would that be due to backlash and not moving in the proper direction? I think my backlash is about 100, but it seems tough to pin down with a C925 EdgeHD. Is the exact value really necessary, or something that is ”close enough” all that is needed?
Rich
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatic refocus with ZWO EAF

#2

Post by admin »

Hi Rich,

it looks like a very good focus curve to me, so I am a bit surprised that it didn't find the best position. However, there have been a good few improvements to the code around this feature in SharpCap 4.1 (you can download the SharpCap 4.1 Beta here : https://www.sharpcap.co.uk/sharpcap/sha ... p-4-1-beta), so giving that a try may be worthwhile.

If you get similar results with the 4.1 beta then please send me the full SharpCap log captured after the graph looks complete (similar to the one above) but the program says it cannot find the best focus position. I can extract all the focus data from the log and then run it through the code that tries to work out the best position and find out why it is not behaving.

cheers,

Robin
Candieman
Posts: 37
Joined: Thu Nov 29, 2018 6:29 pm

Re: Automatic refocus with ZWO EAF

#3

Post by Candieman »

Robin,

Thanks, I just downloaded it. I'll give it a shot tonight, although I wish we had earlier sunsets these days.

Rich
Candieman
Posts: 37
Joined: Thu Nov 29, 2018 6:29 pm

Re: Automatic refocus with ZWO EAF

#4

Post by Candieman »

I had much better success at automated focusing last night by switching to the new beta version of SharpCap (v4.1.10872). I made an initial focus using <Tools> <Focus Assistant> <Automatic Refocus>, then I redid that process a number of times without fail. After that, I switched back to v4.0.9556, and while it worked the first time, it seemed to get lost after that and I had some troubles with it that I couldn’t understand, so I switched back to the beta version and used it the rest of the night. On the second try, I think the 4.0 version tried finding a focus starting with the current position and searching inward, rather than starting at some number of steps out from the current position and working inward. Why that happened, I don’t know, but I have a question about that below concerning both v4.0 and v4.1.

After going back to the beta version, I then implemented automatic focusing into a 5-hour imaging session, automatically refocusing every hour, and that worked well. I had it scan from +300/-300 steps around the current position using 9 steps and a backlash of 150. Here is a screenshot showing the end of one of the focus attempts:
goodfocus070423.JPG
goodfocus070423.JPG (773.15 KiB) Viewed 11332 times
So, I am happy with the beta version, but I have one issue with the Automatic Focus tool I’d like to address. Maybe I’m just missing something, and this is already in SharpCap, but I have not been able to find an option like I would like to see. When I invoke <Tools> <Focus Assistant> <Automatic Refocus>, the tool starts working immediately without giving me any chance to set the options I want for this tool, as one can do in the <Sequencer> as I did in my Sequencer run last night. I think it would be better that when asking for a one-time automatic refocus through <Tools> <Focus Assistant> <Automatic Refocus>, that the user first be presented with a menu for setting the parameters for the tool before it starts, these parameters being: the range of steps to scan through, the step size, the backlash, the direction of the scan, and the option for starting the scan at a specific step number or have it start at the current step number. It just starts up with whatever values it has stored for them, and I don’t seem to have any ability to change them upon start-up, and I’m not sure where they even come from. I think some of them may come from the settings in the Focuser section under <File> <SharpCap Settings> <Hardware>, but I’m not sure of that, but certainly not all of them are there. There is an “Options” button on the screen once the focuser starts, but there’s no way to invoke that before the focuser starts. If I want to change those, I first must hit “Cancel”, then reset the current step number on the focuser since it has probably been changed by this point, then go to the “Options”. That seems very clumsy, and I think that has led to at least some of the problems I’ve had.

I hope what I’ve said here is at least a little clearer than mud. Essentially, I’d like to see a menu pop up as soon as <Tools> <Focus Assistant> <Automatic Refocus> is invoked, a menu that lets the user either choose the defaults in it or specify the ones the user would like to try before SharpCap starts on the focusing process. I think it would be great if all the options were on this one menu.
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatic refocus with ZWO EAF

#5

Post by admin »

Hi,

Good to hear that the beta version works better - a lot of changes have gone in since 4.0, so if there is anything still broken I would want to fix it in the beta, not in 4.0

The refocus button is designed to be a single click action, so you don't get prompted for changing any options. It will basically use the options that were used for the most recent successful focus scan (on the grounds that those options worked, so they ought to work again). The only exception to this is that you can tick the box to prompt to update the selection area on refocus - this is really designed for planetary/lunar/solar focusing where you might need to make sure that the focus tool is calculating on the right area of the image before you set it into action.

If you want to tweak things manually then the thing to do is to bring up the focus tool in manual mode and run a new scan using the settings you prefer (which will from then on be the defaults for refocus - providing they work).

Hope this helps,

Robin
Candieman
Posts: 37
Joined: Thu Nov 29, 2018 6:29 pm

Re: Automatic refocus with ZWO EAF

#6

Post by Candieman »

Robin,

Thanks for the reply. One question about the beta version: When I bring it up, it says it will stop working after 31 August 2023. Will the changes to the focus tool that are in it be put into a new standard version before then?

I assume by running the focus tool in manual mode, that you mean running it in still mode. I’m familiarizing myself with the sequencer (and liking it), and I think I can do a poor-man’s automation of a manual focus with the following in the sequencer:

-Put camera in still mode
-Connect the currently connected focuser
-Set Exposure to 4.0000s
-Set Gain to 300
-Autofocus from offset 300 to -300 with 9 steps allowing for backlash up to 150

This is basically what I’m doing at the start of an imaging sequencer script I put together. Given these commands, it’s then trivial to make changes to any or all of the parameters, if necessary. I guess with all the programming I've done over the past 40+ years, I like looking at lines of code.

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

Re: Automatic refocus with ZWO EAF

#7

Post by admin »

Hi Rich,

I put a time limit on the beta versions to encourage people to keep up-to-date with new updates. By the end of August I will either have a new beta version available which has a later expiry date or a full version of SharpCap 4.1 ready with no time limit. I think the latter is the most likely, but not quite guaranteed.

What I was thinking about for the focus tool in manual mode was really just selecting the 'multi star FWHM' focus tool from the menu and running a scan in one direction or the other. That gives you the opportunity to tweak the settings as desired before starting the scan.

You can certainly automate a customized version of the autofocus scan using the sequencer, and if you save it then it should appear in the 'recently used' list of sequences for easy and quick access. There are also sequencer steps that will save and restore settings so that you can have it put all the camera settings back after the focus scan.

cheers,

Robin
User avatar
mixon
Posts: 16
Joined: Thu May 11, 2023 2:32 am
Location: New Caney Texas
Contact:

Re: Automatic refocus with ZWO EAF

#8

Post by mixon »

Hello Robin,
I've been researching this myself and noticed that their is a Beta version of SC. I'm currently using the 64bit 4.1 version. Would you recommend that I use the Beta Version? I realize this post was back in August, here it is, now December.
Also, wanting to know if the Bathinov mask option would suffice when focusing? how does that apply to refocusing during the actual imaging? Would I create the sequence? I'm all new at this and a huge learning curve!

Thanks
:ugeek: Clear Skies
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatic refocus with ZWO EAF

#9

Post by admin »

Hi,

you can't use the beta versions any more, since they will have all expired (anyway, they contain various bugs that have been fixed in the released version). The best thing to do is just to go to the download page and grab the latest SharpCap 4.1.

Bahtinov masks are great for getting crisp focus, but they do not work nicely with automated sequence imaging, since you would have to keep placing and removing them at the right points during the sequence. Better to get the focus based on FWHM star sizes working, which can run at any point without needing you to put a mask in place then take it off again.

cheers,

Robin
User avatar
mixon
Posts: 16
Joined: Thu May 11, 2023 2:32 am
Location: New Caney Texas
Contact:

Re: Automatic refocus with ZWO EAF

#10

Post by mixon »

Robin
I recently downloaded the latest version of SharCap two weeks ago. 4.1 64bit. I should be ok then.
Duly noted with the Bathinov mask. understood.
However, using the FWHM. . . . . please confirm, when using this feature, Should I be a close to almost in focus point and then launch the FWHM, that will bring me in focus, correct?

Robin,
Adding a screen shot of my current EAF step size positions for positive/negative, Course/Fine. Is the step size correct? basically that's sending a signal to move the focusing tube at the interval steps? I have a 70mm ED SV503 Refractor with 0.8x Field Reducer/flattener, with ASI533mc PRO cam. If I leave the step size the way it is, will the FWHM take this reading to move the focuser in or out to gain maximum focus?

Thank you,
Roy
Attachments
EAF.jpg
EAF.jpg (104.02 KiB) Viewed 8273 times
:ugeek: Clear Skies
Post Reply