Auto adjust focus per filter - failure to work

I have been trying get get this feature to work for several months, with each of the last three versions.
Surely there is some setting I am not aware of that is causing my failures. Or perhaps I have a combination of settings that is triggering the failures that no one else has used. This feature has been around for years and I know a lot people use it successfully, but it does not work for me.

Or more accurately, it does not work for me during real imaging sessions, where it really needs to work. I created a version of my imaging format that I could run during the day to test it. By disabling scope, guiding, plate solving I can run it during the day. It runs perfectly. The offsets for all filters that are defined in the filter settings are honored perfectly. Doing short images through all the filters works great.

With the same settings at night actually taking real images it fails. The failure most often appears to occur when the offset of the next filter requires the focuser to move out. This triggers application of the backlash, but then after the focuser moves out by the amount of the backlash, it does not move back in by the backlash amount. Thus the new position is too far out by the amount of the backlash.

Attached is the log file from my primary (guided) scope. Logs for both scopes exhibit failures.

My focuser settings are intended to operate without any auto focusing runs. I have calibrated very nice linear plots of optimum focus position versus temperature. So at the start of the imaging run I set the optimum focus position for each scope based on the current temperature. For the rest of the session I am relying on the “Auto adjust focus per filter” feature to move the filter to the correct position when each new filter is selected. To do this is should apply two adjustments: 1) the offset of the new filter from the prior filter, 2) any required temperature compensation adjustment. These two adjustments appear to be working correctly.

However, at around 20:01:17, the backlash of 100 is applied, the focuser moved to that position, but then never returned to its requested position.

Here are the lines where I think the focuser moves out by the backlash amount, and then never moves back in to remove the backlash.
[12/04/18 20:01:17.943][DEBUG] [Focuser Thread] Focuser moving to 17670
[12/04/18 20:01:17.946][DEBUG] [Focuser Thread] Focuser backlash active, modified move to 17770

Can you attach your sequence?

Thanks,
Jared

This sequence should be the same as the one I used for the log I sent you. Targets and events are different.A1600OOaf.zip (451.8 KB)

Actually, this feature does not even work if the Backlash is set to 0.
The attached log file and SGF have Backlash set to 0 and turns on “Auto adjust focus per filter”.
At the very beginning of the sequence it fails to correctly set the new filter position when the filter changes.
Here are the relevant lines:

“auto focus sets focuser to 17685 using L”
[12/08/18 21:34:27.535][DEBUG] [Camera Thread] Auto focus is complete (weighted avg method: 17685; HFR 3.83)…

“filter SII is next, offset from L is 100, moves to 17785, fine so far”
[12/08/18 21:34:32.860][DEBUG] [Sequence Thread] Setting filter: SII…
[12/08/18 21:34:32.860][DEBUG] [Sequence Thread] Moving filter wheel, isMoving, check 1…
[12/08/18 21:34:32.860][DEBUG] [Sequence Thread] Moving filter wheel, isMoving, check 1 is complete…
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] Adjust focuser pos per filter: Moving focsuer to focus position (18100)…
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] Adjust focuser pos per filter
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] Old filter: Lum; Focus pos: 18000
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] New filter: SII; Focus pos: 18100
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] Pos delta: 100 steps
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] New position-> (current: 17685) + (delta: 100) = 17785
[12/08/18 21:34:33.087][DEBUG] [Sequence Thread] Focuser moving to 17785
[12/08/18 21:34:33.100][DEBUG] [Sequence Thread] Focuser move call complete
[12/08/18 21:34:34.105][DEBUG] [Sequence Thread] Focuser position matches requested position (17785), continuing…

“next filter is Blue, offset from SII is -80, correct”
“but is uses (current: 17685), when current is actually 17785, now off by 100”
[12/08/18 21:34:58.602][DEBUG] [Sequence Thread] Setting filter: Blue…
[12/08/18 21:34:58.602][DEBUG] [Sequence Thread] Moving filter wheel, isMoving, check 1…
[12/08/18 21:34:58.602][DEBUG] [Sequence Thread] Moving filter wheel, isMoving, check 1 is complete…
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] Adjust focuser pos per filter: Moving focsuer to focus position (18020)…
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] Adjust focuser pos per filter
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] Old filter: SII; Focus pos: 18100
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] New filter: Blue; Focus pos: 18020
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] Pos delta: -80 steps
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] New position-> (current: 17685) + (delta: -80) = 17605
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] Focuser moving to 17605
[12/08/18 21:34:58.813][DEBUG] [Sequence Thread] Focuser move call complete
[12/08/18 21:34:59.824][DEBUG] [Sequence Thread] Focuser position matches requested position (17605), continuing…

I have found no workaround for this bug.

I guess I’m missing where you think it’s going wrong? Seems that temp compensation is also enabled. I see multiple temp compensation moves between filter changes and when SGP changes filters it uses the current position and applies the offset. If you want to provide the log where the snippet came from I can check that too.

Thanks,
Jared

Here are my filter offsets:
L 18000
R 17990
G 18005
B 18020
Ha 17945
SII 18100
OIII 17965

Here are the first three filter moves:
–Should be at--------Actually goes to
L----- 17685 -------- 17685
SII —17785 -------- 17785
B ---- 17705 -------- 17605

Sorry, I meant to attach this log, just overlooked it.
The offending line in the log is:
[12/08/18 21:34:58.810][DEBUG] [Sequence Thread] New position-> (current: 17685) + (delta: -80) = 17605

It is using the current position as 17685. But the current position is actually 17785, which is the previous move to filter SII. The delta of -80 is correct, but should be applied to the actual current position of 17785.

None of the temperature offsets have anything to do with this. All of this happened within the first 3 filter moves of the sequence. The temperature did not change during this interval.

Most of the rest of the log is also irrelevant for this discussion. As soon as I saw that it was screwing up, I turned off “Auto adjust focus per filter” so it would not screw up the rest of the nights imaging.

20181208.zip (676.9 KB)

As I had thought it was because of the temperature compensation running. If you look up a few lines you’ll see:

[12/08/18 21:34:55.937][DEBUG] [Sequence Thread] Temp Compensation: Using focuser temp...
[12/08/18 21:34:55.937][DEBUG] [Sequence Thread] Temperature compensation: Adjusting for 0.0 degrees (end: 31.1; start: 31.1; coefficient: 3) for 0.0 steps...
[12/08/18 21:34:55.948][DEBUG] [Sequence Thread] EventMarker 19 - t:RCS2-032727 Gravitational Lensing (1); e:0; f:1; o:
[12/08/18 21:34:55.948][DEBUG] [Sequence Thread] EventMarker 20 - t:RCS2-032727 Gravitational Lensing (1); e:0; f:1; o:
[12/08/18 21:34:55.949][DEBUG] [Focuser Thread] SGM_FOCUSER_MOVE_ABS message received...
[12/08/18 21:34:55.949][DEBUG] [Focuser Thread] Focuser moving to 17685

I think it’s setting the focus position based off of the temp compensation. I’ll have to validate this but it seems like in the mean time you can disable temperature compensation to address this.

Thanks,
Jared

So the bottom line here is: you can’t use both “Temperature Compensation” and “Auto adjust focus per filter” at the same time.
Hopefully there is a fix for this coming soon. The option to turn off one or the other is what I have done already: I turned off “Auto adjust focus per filter”.

Depending on what combination of filters I use on each scope, that is the best option.
The usual temperature drop this time of year in Taos,NM is 20 degree F over the course of the night.

For my AG12 Newtonian:
Temp compensation is +2.6 steps/degree F. This translates into 52 steps over the night where my auto-focus increment is 30 steps or almost 2 increments, significantly out of focus.
The focus spread for LRGB is 30 steps which is less than 50 steps.
The focus spread for HaSiiOiii is 20 steps which is less than 50 steps.
Total focus spread for LRGBHaSiiOiii is 75 steps which is more than 50 steps.

For my TV NP127is:
Temp compensation is -5.0 steps/degree F. This translates into about 100 steps over the night where my auto-focus increment is 20 steps, thus a total of 5 increments, ie. grossly out of focus.
The focus spread for LRGB is 40 steps which is less than 100 steps.
The focus spread for HaOiii is 5 steps which is less than 100 steps.
Total focus spread for LRGBHaOiii is 60 steps which is less than 50 steps.

So if I limit my filter selections for the entire night to only LRGB, or only HaSiiOiii, I get less out of focus by keeping temperature comp only and disabling “Auto adjust focus per filter”.

Minor BUG Note: the log indicates C when it really is F for focus temp readings.
Minor ENHANCEMENT: Please allow more precision for “Temperature Compensation”. Tenths would be great.

Any progress in fixing this bug? This is a very serious bug for my use of SGP, and I would think for a lot of other folks.

The consequence of this bug is that you can’t use both of these features at the same time:
“Temperature Compensation” and “Auto adjust focus per filter".

I am wondering if this bug has been fixed in recent releases. I have not seen any mention of it.
It has not been a problem for me since I reported it because I quit using the SGP Temperature Compensation feature. Instead, If have been using Temp comp directly in my focuser software, which is RigelSys. Since I use filter offests for the filters, I only focus with the L filter which bypasses this bug.

@jmacon

This is fixed in betas > 3.1.0.291