I always thought the autofocus routine approached the final focus position from one direction only i.e., a ‘there and back’ movement so it overshoots and returns to position, thus eliminating any backlash that may reside in the drive connection. Whilst testing a new motorised focuser I made I noticed this didn’t happen, and so the amount of backlash in the motor gearbox (a NEMA11 19:1 planetary gearbox stepper) now becomes significant. The ASCOM driver I’m using does not include any parameter to compensate for this. So, am I mistaken in they way autofocus is supposed to work? Any chance of adding this functionality if it isn’t included?
The way it could work - after the focus run when moving to the focus position it would just move 1 x StepSize parameter past then approach position always moving the focuser inwards.
OK, I rooted about in the settings and found it - pretty well hidden under the ‘Other’ button on the control panel settings sheet! Would be nice if a button also appeared on the Focus Control settings dialog too…
In practice, the focus controls are normally the things you tweak dynamically - the backlash setting is more of a one-time set and forget for a particular piece of hardware and not affected by target. It may be better to avoid cluttering up the focus control settings dialog.
After spending a couple of days working on this I found an issue:
My focuser has 15500 steps total travel, and I have backlash compensation set to 15 steps.
If I start at 0 (zero) and move (using the goto button) to 5000 steps the move appears successful but communication to the focuser fails immediately the move has completed. Only disconnect/re-connect (after unplugging the USB lead) gets me my connection back. In fact any move >5000 does this, and a move to 15000 in one operation is possible but the connection times out when it gets there.
However, a move less than 5000 (minus (15+1) is OK - i.e., 4984 is fine, and of course I can move the focuser fully out to 15000 by smaller increments.
er, no. Sounds like a program bug to me - and it concerns the backlash compensation. Moving the focuser IN then all movements of any length are fine.
I start at 0 because that’s where I leave the focuser when I remove the OTA from the mount (actually, I leave it physically a little bit out but it’s set to zero at that point). I need to move it to ~8000 or so when I set up because that’s where I expect focus position to be.
Your focuser likely has a max movement of 5000 steps at one go. We currently don’t check this property in SGP and perhaps we should. I don’t think it has anything to do with backlash compensation, likely just a red herring, just that the requested move is going beyond that amount. It’s interesting that it is only an issue in the out direction.
You can try disabling backlash compensation and testing this hypothesis.
I’ve added some logging for the MaxIncrement that will be out with the next 2.5 beta. Since yours seems asymmetric (works for in, breaks for out) I’m a little hesitant about adding this right now as it’s non-trivial and it might not be the actual issue.
Movements are fine without backlash compensation enabled, I;ve set my max move to the same as the total movement (15,500 steps). If I ask for a 5000 OUT movement then the focuser stops at 5015 and does not move inwards by the 15 steps of backlash compensation. As said, if I reduce the requested move to 5000 minus the 15 (+1) so 4984 steps then it’s OK, but asking for just one more step (4985) it locks up. 5000 is the critical number.
Yep, I managed to work that fix out… However it’s a bug and needed reporting.
If running remotely it is a little more inconvenient should you happen to run into this bug - your focuser stops working with no error message and you need to physically go out and power off (or disconnect the USB cable) before you can get control back. Anyway, that’s the way it is.