AutoFocus Update Feature Request


#21

And one more piece of info from 2/3/2017

– On Fri, 2/3/17, Jared forums@mainsequencesoftware.com wrote:

From: Jared forums@mainsequencesoftware.com
Subject: [Main Sequence Software] [PM] SGP and timeout in backlash
To: astrogene1000_stuff@yahoo.com
Date: Friday, February 3, 2017, 11:22 PM

Gene,
Thank you! Played with it for a little bit and you’re
right. In the auto focus we were not correctly
blocking for focus moves. This seems to be a fairly
recent change. I’ll address it and get it ready for
the next beta.

Thanks,
Jared


#22

@astrogene1000_stuff

Thanks for the detailed information. Unfortunately, I am out of time for the next few days. If anyone is inclined, they are welcome to test out the new changes. If they work, awesome, if not, I’ll attempt to address next week.


SGPro 3.0.0.X Issue Thread
#23

Hi Ken,

Thanks for the quick fix. I am currently on v2.6.0.24. WIll I need to upgrade to version 3 before I can load up 3.0.0.4 to test? Not a big issue as I was planning to upgrade shortly anyway.

The other issue is the weather! :frowning: Northeast Ohio in November and December, need I say more!

Regards,
Mark


#24

Ken, ran it here, looks better for sure!

[11/21/17 20:36:57.086][DEBUG] [AfChartThread] Showing AF chart dialog…
[11/21/17 20:36:57.115][DEBUG] [Camera Thread] Auto focus data
[11/21/17 20:36:57.115][DEBUG] [Camera Thread] - Data Points: 7
[11/21/17 20:36:57.115][DEBUG] [Camera Thread] - Step Size: 10
[11/21/17 20:36:57.115][DEBUG] [Camera Thread] - Current Position: 2000
[11/21/17 20:36:57.115][DEBUG] [Camera Thread] - Initial Move Position: 2030
[11/21/17 20:36:57.127][DEBUG] [Camera Thread] AF Darks exception: The path is not of a legal form.
[11/21/17 20:36:57.128][DEBUG] [Camera Thread] Moving focuser to next position (2030)…
[11/21/17 20:36:57.130][DEBUG] [Focuser Move Thread] Focuser moving to 2030
[11/21/17 20:36:57.156][DEBUG] [Focuser Move Thread] Focuser move call complete
[11/21/17 20:36:58.175][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser position 2030 matches requested position 2030
[11/21/17 20:36:58.175][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Waiting for focuser to report done…
[11/21/17 20:37:20.406][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser reports it is done moving, continuing…
[11/21/17 20:37:20.406][DEBUG] [Camera Thread] Focuser move complete…
[11/21/17 20:37:20.419][DEBUG] [Camera Thread] Focuser position matches requested position (2030), continuing…
[11/21/17 20:37:20.428][DEBUG] [Camera Thread] Calculating step metric…
[11/21/17 20:37:20.431][DEBUG] [Camera Thread] Taking auto focus frame(s)…

[11/21/17 20:37:29.694][DEBUG] [Camera Thread] HFR value was 0 three times… probably not going to get anything else, continuing…
[11/21/17 20:37:29.725][DEBUG] [Camera Thread] Moving focuser to next position (2020)…
[11/21/17 20:37:29.726][DEBUG] [Focuser Move Thread] Focuser moving to 2020
[11/21/17 20:37:29.746][DEBUG] [Focuser Move Thread] Focuser move call complete
[11/21/17 20:37:30.758][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser position 2020 matches requested position 2020
[11/21/17 20:37:30.758][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Waiting for focuser to report done…
[11/21/17 20:37:52.772][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser reports it is done moving, continuing…
[11/21/17 20:37:52.774][DEBUG] [Camera Thread] Focuser move complete…

[11/21/17 20:38:01.749][DEBUG] [Camera Thread] HFR value was 0 three times… probably not going to get anything else, continuing…
[11/21/17 20:38:01.758][DEBUG] [Camera Thread] Moving focuser to next position (2010)…
[11/21/17 20:38:01.758][DEBUG] [Focuser Move Thread] Focuser moving to 2010
[11/21/17 20:38:01.777][DEBUG] [Focuser Move Thread] Focuser move call complete
[11/21/17 20:38:02.786][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser position 2010 matches requested position 2010
[11/21/17 20:38:02.786][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Waiting for focuser to report done…
[11/21/17 20:38:24.802][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser reports it is done moving, continuing…
[11/21/17 20:38:24.802][DEBUG] [Camera Thread] Focuser move complete…

[11/21/17 20:39:28.845][DEBUG] [Camera Thread] Focuser move complete…
[11/21/17 20:39:28.858][DEBUG] [Camera Thread] Auto focus data
[11/21/17 20:39:28.858][DEBUG] [Camera Thread] - Data Points: 7
[11/21/17 20:39:28.858][DEBUG] [Camera Thread] - Step Size: 10
[11/21/17 20:39:28.858][DEBUG] [Camera Thread] - Current Position: 2045
[11/21/17 20:39:28.858][DEBUG] [Camera Thread] - Initial Move Position: 2075
[11/21/17 20:39:28.864][DEBUG] [Camera Thread] AF Darks exception: The path is not of a legal form.
[11/21/17 20:39:28.866][DEBUG] [Camera Thread] Moving focuser to next position (2075)…
[11/21/17 20:39:28.866][DEBUG] [Focuser Move Thread] Focuser moving to 2075
[11/21/17 20:39:28.885][DEBUG] [Focuser Move Thread] Focuser move call complete
[11/21/17 20:39:29.896][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser position 2075 matches requested position 2075
[11/21/17 20:39:29.896][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Waiting for focuser to report done…
[11/21/17 20:39:53.069][DEBUG] [Focuser Move Thread] MoveFocuserAbsBlocking: Focuser reports it is done moving, continuing…
[11/21/17 20:39:53.069][DEBUG] [Camera Thread] Focuser move complete…
[11/21/17 20:39:53.079][DEBUG] [Camera Thread] Focuser position matches requested position (2075), continuing…
[11/21/17 20:39:53.088][DEBUG] [Camera Thread] Calculating step metric…
[11/21/17 20:39:53.088][DEBUG] [Camera Thread] Taking auto focus frame(s)…


#25

Quck update. I purchased, downloaded and Installed the new version SGPro V3.0.0.4 onto my systems. Now it’s a waiting game for some clear nights to show up to tests. Based on what Gene posted yesterday, the fix looks promising.

Happy Thanksgiving to all.
Regards,
Mark


#26

@astrogene1000_stuff @mahaffm Thanks for the help. I’ll be a little scarce through the holiday, but can test this more strenuously early next week.


#27

I’ve tested as well and it seems better, at least a delay after the focus position has been reached is honoured.

I couldn’t get Astrogene’s simulator running so modified the ASCOM simulator to add a delay and set it to 5 seconds. With 2.6.0.24 the next focus image was acquired almost instantly showing that SGP had started the image acquisition before the focuser had reported that it had stopped while with 3.0.0.4 it waits until until IsMoving returns false.

The various ASCOM logs show this all quite clearly.


#28

So you did find a problem as stated in the thread, not just a band aid. “Better to fix the underlying problem than hide it.”, always pays to research first.


#29

You are coming across very aggressively, I’m trying to help - and confirming what you found.

Yes there was a problem which was that SGP seemed to be using the position rather than IsMoving to determine when the move had finished. It seems to have been fixed.

The band aid would have been to add a delay in SGP. This would not have solved the real problem but attempted to hide it.

A delay would not have been a reliable solution because if the focuser move happened to be a long one it may not have been long enough.

BTW @Ken or @Jared will this fix be added to a future 2.6 upgrade?


#30

The issue with SGP was seen and confirmed last Feb, the original correspondence stated as such (quoted previously in this thread). Also as stated in the thread, the mount and the rotator have arbitrary delay settings available for the user. I gave up out of frustration of being ignored last time around, anything that I thought got in the way of pooh-poohing the real issue this time around is not something I was willing to accept, which is what I took your comments to be, all it took was a little research to see the issue.


#31

I really appreciate that Gene put in so much work to help identify the problem. I have worked with Gene over the years both with his guide interface and his focuser and really appreciate his can-do approach.

I also want to thank Mark for resurrecting this issue when others of us had just plain given up - largely out of exhaustion. And thanks to the SGP developers for giving it another look.

I’m glad this bug was finally found, but I think an important thing to note is that this problem has been reported numerous times - and in each thread there are other people saying they have the same problem and want some kind of delay.

Here is my post from July '16:

So I think many more people were impacted - including those with Crayford focusers who wouldn’t even have noticed focus was changing during exposure. Now that the bug has been identified it should be more clear how many people were affected. I’m just not sure about other people who had this problem and didn’t have a different camera to switch to. Did they just give up on autofocus and sgp?

There were many assumptions going on - but a key point in all of it is - SGP autofocus just doesn’t work at all with my current setup. Can it be fixed?

My assumption was that a delay was needed and the exposure is happening too soon after the movement. At the same time - the counter assumption was - my setup is weird and has problems - and adding a delay is not justified since things seem fine for most people.

When a user has a fundamental problem that kills overall functionality - it is quite irksome to be told that efforts to fix it should not be attempted since it would violate some “pure” concept of the software design. Especially when things like delays are all over the software - and it isn’t pure in the first place.

At the core - I was a user with a setup and a camera - and autofocus just did not work at all - because every focus image was streaked. If you can’t autofocus with your setup - most of sgp’s features are useless because otherwise you need to focus manually during the imaging session.

Meanwhile - I was able to use other cameras and it all worked fine - so I did have a fallback. But since it worked just fine with other cameras - it was evidence my equipment was working fine and something else was causing a problem with the other cameras during focus. There was a bug in there - and it was insidious - but certain setups showed the problem consistently.

If anyone has had ugly focus curves and erratic autofocus behavior - this fix may help - and they should look at their autofocus images to make sure the stars aren’t streaked.

And even if their curves have looked good so far - they have a chance to improve now if focus was changing during exposure and they didn’t even know it.

Frank


#32

Update on the Auto Focus (AF) “IsMoving” bug. Last night the clear skies God was looking favorably upon us North East Ohio folks and I was able to test out the fix that Ken made to the AF “IsMoving” bug in V3.0.0.4. and the bug appears to be fixed. AF is now waiting for the “IsMoving” before kicking off the AF image request. I am getting the best V-curves I’ve ever gotten with this Camera/Scope. However, I did find I needed a 2 second delay that I was able to do using Gene’s The nSTEP ASCOM Driver that he integrated a user input delay into his focuser driver 6.0.7. Anything less than 1.5 seconds and I was not getting a very good V-cure graph so I landed on 2 seconds to be on the safe side. See before and after graphs below:

Before fix

After fix with no delay

After fix with 2 second delay

I still believe adding a user input delay into the AF would be a benefit. As I believe any mechanical that is moving, ie Telescope, Filter Wheel, Focuser, and Rotator would all benefit.

I wish to thank Gene and Ken for their work on finding and fixing the bug!

BTW Ken you are not going to believe this but now I am seeing that the camera is taking images before the rotator stops. I’ll post this on another thread later but see image below. Maybe when you fixed tor AF bug something got broke between the rotator and camera.

Since I might be the only one using V3.0.0.4 no one else has found this.

Regards,
Mark


AF, Rotator and
Old and New Auto Focus Method
#33

I’m hesitant to jump in here both because I’m late to this thread, and because I have no expertise on this at all. But I’ve been using the Rigel system on my pre-Edge (ie, moving mirror) C11 for years with no real trouble. A couple years ago Frank pointed out that the focuser was ending focus in the wrong direction, and Gene modified the software to solve that. Since then, no problems with AF. I get good v-curves almost every time. I use an SXVR-H694 camera - no shutter - so maybe that has something to do with it. But it’s working well. Maybe that adds a data point to help with this issue.

Kevin


#34

Hi Kevin,

Thanks for the info. The bug appears to be fixed as of 3.0.0.4. I just recently downloaded, installed and tested 3.0.0.5 last night and it appears the AF is now waiting for the “IsMoving” to return false before taking the image during AF. I think, depending on the the equipment, most folks never noticed this problem. In fact I never experienced the focusing issue until I started using the QHY174 camera. I’ve been using SGPro for around 2 years before this issue appeared. Gene worked with the SGP developers to identify the bug and got it fixed, BTW thanks again Gene.for the help on this. Also @freestar8n, Frank. was using the same camera and experience the same AF issue. It does appear to be something related to the type/brand of camera and maybe the focuser driver that appears to be more susceptible when the “IsMoving” is not being honored by the AF routine in SPG.

Anyway the short story is the AF “IsMoving” bug appears to be fixed!

Regards,
Mark


www.mainsequencesoftware.com