I've managed to get debugging going with a joystick connected, and see that it is time based, it always seems to be 1s, and don't know where that is set? The other variable is the speed.
I could override this function, but with what? I think absolute position increments might work, but would be tiny, and only allowed one increment per second. The increments would be tiny because I think a maximum step size of 4 steps would be used, regardless of step mode. This is because I beleive ther are supposed to be about 10-12 steps at the focal point,(?) and so would give two or three presses at focus. My focuser at full step has 4900 steps full travel so
4900/4=1225s / 60 = 20 minutes, full travel!
Or perhaps speed 0 = 4 steps, speed 1= 20th full travel and speed 2=10th full travel? (if we went this way then we may as well have 1 step at speed 0, which might be a pain for the 1/16th 1/32nd step settings, but hey ho).
Any thoughts, anybody?
I'm going to code steps of 1,10 and 100 and see how it feels.
Having coded that, and then playing with the speed, it dawned on me that I could have just used the set relative step! I did also note that I could cause small fractions of steps, by feathering the joystick button, so I don't understand how that is working?
I appreciate your efforts to improve the joystick operation.
My feeling is that it should be nice if effectively you could use the set relative step. In that way each user could set a number of steps according to the gear reduction of his focuser system.
But maybe there is some drawbacks to implement this solution...
Yes there does appear to be some draw backs, it does not seem that the relative steps step value is available in the derived class for the focuser. Even if it was it would need to be set each startup. I'm back to implementing a 1, 10, 100 movement based on speed, which does not take much effort to implement, and retains the setting between power cycles. Would this be better than the current solution, though I suspect the current solution is not behaving as expected.
I am thinking I will just leave as is for now, until someone explains how the in out joystick is intended to work.
So in theory you add more buttons and you can change the behavior here. If the relative steps were set to say, a 100, then in theory pressing the button would move them by this much. Feel free to play around with the code in order to get the most desirable behavior keeping in mind that it should work for all kind of focusers (DC and steppers).
Thanks for the heads up as to where in the code to look, and it looks to me like the code wold already do what we probably want. Unfortunately because this focuser has variable speed AND relative position, then the times move is used in preference the relative move.
From my point of view I would have thought relative move should have been first choice as it maintains accuracy of actual position.
My FocuserPro2 supports three speeds, so I assumed this means it is variable speed, but it is a stepper motor and not DC. Was this the intended purpose of variable speed or have I misunderstood? I don't see why a stepper motor would ever want to use a timed move as opposed to an abs/rel move.
I appreciate this is a global function, and so should not assume that everyone else would agree with my opinion, so how do we move forward on this?
I actually had the exact same though. Relative should be preferred over variable. I would make this change now, but please take a look at it in more depth so that it can be suited for more functionality later on.
No not really, that is not the issue. I was just pointing out that if a focuser is defined to support variable speed(as this focuser is), then joystick button defaults to a "timed move" rather than the set "relative steps". I think it would be better the other way around.
I just tested the myFocuserPro2 with the Jasem fix. The joystick number of steps follows perfectly the relative position setting and, cherry on the cake, the backlash is taken into account. It seems to me that it was not the case with the precedent solution.