One Click autofocus

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
chongo228
Posts: 204
Joined: Fri Nov 24, 2017 3:34 am

Re: One Click autofocus

#11

Post by chongo228 »

admin wrote: Wed Dec 15, 2021 1:51 pm Hi,


* have a connected focuser set up
* have previously run a focus scan/goto best score successfully.

The refocus will use the focus scan settings from your last successful scan/goto best position (including using the same focusing tool that you used). The scan will be centered around your current focuser position

cheers,

Robin
When you say the scan will be centered around current position do you mean it will scan out half of what my settings are and start scanning in?

If I'm at 5000 steps and my settings will span 200 steps, will SC run from 5100 to 4900?
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: One Click autofocus

#12

Post by admin »

Hi,

yes, that's exactly right. The theory is that the scan settings from the previous run are wide enough to cover the likely amount of focus drift, and that the current position is one where you have good, but not perfect, focus.

cheers,

Robin
MikeHuerto
Posts: 75
Joined: Thu Jan 21, 2021 12:05 pm
Location: Spain

Re: One Click autofocus

#13

Post by MikeHuerto »

Hi Robin
I just tried this feature. It basically worked as described. I actually ended up ´calibrating´ by first doing several scans to determine the correct values to put into the Option tab to give a nice hyperbolic graph that ran from about 20 down to 5 and back up to 20 (Scan step size 20, Max count step 10, Sample 3). This gave me 4 values either side of the best value. Then I ran the autofocus. This basically worked, and returned the focuser to the best focus, except it ran 24 steps, not the 10. I´d obviously like to keep the steps to a minimum when imaging. I tried this 2-3 times with the same result. I assumed it would use the same values that I set in the options tab for scanning? Is there another tab to set the autofocus values (scan step size, max step, backlash etc) to use in the autofocus routine? Or is this a bug, that you will ask me to send a log for ?

Attached is a screen shot of the scan. FWHM of 6 is good for my 14 inch Dobson!!! Unfortunately, I didnt make a screen shot of the autofocus routine, and now the clouds have rolled in!

Thanks for developing this feature - its a lot easier than running outside with a Bahtinov mask!

Best

Mike
CaptureSCfocuscan.PNG
CaptureSCfocuscan.PNG (307.47 KiB) Viewed 849 times
Bortle 5
Skywatcher GOTO Synscan 14" Dobson
Skywatcher 130PDS on HEQ5
ZWOASI224MC and ASI294MCPro
Laptop = Lenovo Legion 5 FullHD 144Hz (Intel Core i7-10750H, 16GB RAM, 512GB SSD, NVIDIA RTX2060-6GB, Windows 10
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: One Click autofocus

#14

Post by admin »

Hi Mike,

you had better send me the log of the time that did 24 steps not 10 - there are situations where it might do 11 instead of 10, but it should not go beyond that. Hopefully the log will show something.

Glad that it is generally useful though.

cheers,

Robin
MikeHuerto
Posts: 75
Joined: Thu Jan 21, 2021 12:05 pm
Location: Spain

Re: One Click autofocus

#15

Post by MikeHuerto »

Hi Robin
Thanks. I will have to run it again when the clouds pass. I did not have the focusser selected in the settings logging tab (and did not review and save in the Help log popup window either).

Also - a related question: in Settings/Hardware/Focusser, there are 4 options. I am using the Dream focuser via ASCOM. For Backlash compensation, do I 1) check the radio button = Handled by SharpCap.
2) and is the 'steps' value field in the same units as the 'Max step count' in the Scan-options tab?

Also 3) in Setting/Hardware/Focuser, there is a radio button for Overshoot. But I cannot select both the SC backlash button AND the Overshoot direction. I assume the Overshoot-direction and amount is irrelevant because the autofocus automatically selects the direction in which the Scan was performed, and the overshoot steps value will be determined by my starting position and Scan Step size (as selected in Option). Is that correct?

Best

Mike
Bortle 5
Skywatcher GOTO Synscan 14" Dobson
Skywatcher 130PDS on HEQ5
ZWOASI224MC and ASI294MCPro
Laptop = Lenovo Legion 5 FullHD 144Hz (Intel Core i7-10750H, 16GB RAM, 512GB SSD, NVIDIA RTX2060-6GB, Windows 10
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: One Click autofocus

#16

Post by admin »

Hi Mike,

the 'Handled by SharpCap' and 'Overshoot' options are two mutually exclusive ways of dealing with backlash, both can give good results:

* Handled by SharpCap does full backlash compensation, based on the number of backlash steps specified (which is in the same units as max steps). If this value is correct then from the point of view of controlling the focuser in SharpCap, it should behave as a zero backlash focuser when moving in either direction. If you reverse direction (for instance have been moving +ve, but now move by -5), SharpCap will apply the correct adjustment to the movement to take up the backlash before applying your desired move.

On the down side, the focuser position value shown in SharpCap may be different from that seen in other applications due to the backlash offset, and the backlash amount needs to be pretty accurate.

* Overshoot takes a different approach - when this is selected, SharpCap will always approach a target position from a single direction, so if you move from 24000 to 24100, that will happen directly, but if you move from 24100 back to 24000, SharpCap will first overshoot (maybe down to 23000) and then approach 24000 from below.

This approach also removes backlash as long as the overshoot amount is at least as big as the backlash (no need to be exact, if you know your backlash is about 950, set overshoot to 1000). On the downside, you need to get used to working your focuser movements in a single direction when possible to avoid lots of delays with the overshoot movements.

cheers,

Robin
MikeHuerto
Posts: 75
Joined: Thu Jan 21, 2021 12:05 pm
Location: Spain

Re: One Click autofocus

#17

Post by MikeHuerto »

Hi Robin

Clearish skys tonight so I was able to run some more tests.

Ive attached 2 logs for two separate sessions.

The step count appears to increase by 1 every time I run autofocus. So the first time I ran it it did 11 steps. Then each time I ran autofocus it added one or two steps. I checked the options panel the first few times, it still showed 10 steps.
The first time I ran autofocus it was ok at10 steps. Then each time it increased by 1 or 2 steps: at 20:03 =11 steps, 20:08 =12 steps, 20:25 15 steps, up to 18 steps. Below are two of the log lines from the first autofocus in the first session to the last autofocus in the second session.


Debug 19:55:10.731063 #1 Sequencer : Info : 'Refocus scan configured to use Multi-Star FWHM Measurement for scan about 1650 from 1600 to 1700 using 10 steps of 10, 3 samples, allowing for backlash of up to 0' while running step Refocus using the same settings as the most recently used autofocus run


Debug 20:25:11.267724 #1 Sequencer : Info : 'Adjusting step count to 18 to cover the range with step size of 5' while running step Autofocus between 1541 and 1631 with 15 steps allowing for backlash up to 0

Interestingly. When I started the first session, I noticed that the option tab had reset to 24 (the value it had acquired last night- even though the option panel only showed 10 last night. So i reset it to 10 steps again. I monitored this for the first few autofocus runs in the first session, and it stayed at 10. BUT when I restarted SC for the second session it had changed to 15!

I also note that from the 20:25 log above, the autofocus routine decides by itself the number of steps and step size to cover the range it picks.

I did try adjusting the backlash setting in Settings/Hardware/focuser from 20 to 30 to 40 (the SC controls radio button). But from what I can read in the log, it did not recognize it and shows backlash zero? Eeven after restarting SC.

I´ve also attached a screenshot of the last autofocus curve, which looks pretty good. Different from last night, I see that tonight it moved in the OUT direction (green), even though I did the scan in the IN direction. Was this because I clicked the SC radio button in settings/hardware?

Either way, it does appear to be working, and does refocus the camera nicely.

By the way, the SESSION log 1 contains some detailed focuser log info (i switched this on between 19:26 and 19:31, just in case it could provide you with any additional insights.

What do you think?

Best

Mike
SCfocusSESSION 2.txt
(111.24 KiB) Downloaded 32 times
SCfocusSESSION 1.txt
(905.78 KiB) Downloaded 32 times
CaptureSCautofficusBL40-restart18steps.PNG
CaptureSCautofficusBL40-restart18steps.PNG (426.06 KiB) Viewed 828 times
Bortle 5
Skywatcher GOTO Synscan 14" Dobson
Skywatcher 130PDS on HEQ5
ZWOASI224MC and ASI294MCPro
Laptop = Lenovo Legion 5 FullHD 144Hz (Intel Core i7-10750H, 16GB RAM, 512GB SSD, NVIDIA RTX2060-6GB, Windows 10
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: One Click autofocus

#18

Post by admin »

Hi Mike,

thanks for testing so thoroughly - I think I see what is going on - it is recording the range and the step count for use the next time, but unless the range is an exact multiple of the step count, the next time around it calculates the step size needed (maybe 5.5 focuser steps), rounds down to 5, then increases the number of steps to compensate for the rounding down. I know what to look for now, so should be able to fix :)

On the scan in the positive direction thing, If you have enabled 'overshoot' backlash handling in the settings then that forces focus scans to always run in the direction you have picked in the overshoot options, overriding any previous saved direction. That's because a scan in the opposite direction to the ovreshoot would be horrible - at every step it would have to move away a big amount to come back to the new position with enough overshoot movement to wipe out the backlash!

cheers,

Robin
SkyShed Admin
Posts: 24
Joined: Wed May 18, 2022 4:43 am

Re: One Click autofocus

#19

Post by SkyShed Admin »

Hi Robin,

Huge fan. Highly recommend SC to our SkyShed owners and friends. Lots of fun, smart, and stable too. Love it. Love all the new features too.

You've seen my images taken with SC on our FB page. Very thankful ;)

Setting up an EAF on my 14" Edge w/ Hyperstar. Doing a focus scan. Had no idea about numbers so I went with the default settings for the run. Can't remember exactly, I think I saw 63 stars or such noted. I got triangles all over the place. Not a nice parabolic. There was a best point, but the run would never finish. Best number was in the 3's. I assume smaller is better.

My next opportunity is Friday night. Might be good for first image of the season as well, if I can get a good focus w/o climbing up and down w/ the Bahtinov. That would be nice. :)

Normally I'd read more and experiment, and I have noted what I've read here. It's our busiest time of the year and I have to "sneak out" to my POD MAX when I can to image. Not a lot of time to experiment. I have to get up and running in a few minutes if I can. Would be nice to do a focus run first, quickly.

Any tips on what settings I might try with a EAF, Edge 14" at F2, Altair 26C, Bortle 3+ ?

Or other SC owners with the same type of set up? Much appreciated!

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

Re: One Click autofocus

#20

Post by admin »

Hi Wayne,

check that your version of SharpCap is right up to date (latest on the download page). The very latest versions have new code that will stop a focus scan once a best focus position has been determined (parabola curve drawn over the data points). There is also an option to make the focuser automatically move to the best focus point when the scan is done if it has identified the best focus point.

The numbers you are seeing are FWHM star widths (actually HFD values), so 3 is pretty good, 2 is better, 4 worse, etc. Exactly how good you will get depends on seeing, pixel size, focal length, etc.

For focus on stars I would recommend setting as follows :

Multi-star FWHM measurement
Max step count : ~15
Samples to collect : 1
Move to best focus position and smart scanning both ticked
Leave the stuff on the left at defaults

The thing you have to work out yourself is the scan step size - that's how much it will move the focuser for each of the 15 steps of the scan. It needs to be big enough to move from noticeably out of focus one side, through best focus to out of focus the other side. Making it too big though will give problems - it shouldn't go to completely out of focus either side (no stars detected).

Hope this helps,

Robin
Post Reply