Focuser reporting incorrect position at start up

Issue #646 resolved
David Banks created an issue

I am using the latest build of N.I.N.A. and I have the very latest version of ASCOM and Lakeside drivers installed.

The issue is that every time I connect my Lakeside focuser NINA reports the position and 'move to' target as 5000 - this drives the rack and pinion focuser hard against the stops and stalls the motor - not good for any of the parts involved.

Strangely enough if I disconnect then reconnect it always reports the correct position and 'move to'.

This is reliably repeatable. See attached images of first connection and second connection - particularly the numbers highlighted in yellow.

Any ideas ???

Comments (29)

  1. Dale Ghent

    How is a move-to position of 5000 being specified here? Did you type that in and press the Move button? If you connect a focuser and then do nothing, NINA doesn’t do an uncommanded move of the focuser. The only time NINA moves the focuser is when the user actively commands it in some way, or during autofocus.

  2. Stefan B repo owner

    Most likely cause is that the Stepper is a relative one and Nina Just uses an arbitrary number of 5000 and then it has a Strange Side effect with the maxstep value

  3. David Banks reporter

    @Dale Ghent I don't know how 5000 is being specified - I haven't input it anywhere. If I click any of the move arrows it immediately tries to drive to 5000 and hits the stops as its max position is 1930. Invoking autofocus does the same thing. Disconnect it - reconnect it and it works perfectly - it does this every time i.e. it is easily and reliably repeatable. the correct focus position and maximum value is being accurately picked up and reported by ASCOM.

  4. David Banks reporter

    @Stefan B I dont know whether the stepper is an absolute or relative focuser but this issue really needs fixing - if I remember to disconnect and reconnect then all is well but if I forget or restart NINA then it is going to damage an expensive Takahashi rack and pinion focuser !! It doesn't appear to be a ‘glitch’ as it happens every time. I really hope it can be fixed as otherwise this is a perfect piece of software!! The log is attached above if that’s useful??

  5. David Banks reporter

    @Stefan B The Conformance log and an ASCOM Diagnostic log are attached.

    Many many thanks.

  6. Stefan B repo owner

    It Looks like you have Run the Check on the Simulator. You need to select your focuser Driver First and then reperform the check

  7. David Banks reporter

    @Stefan B Sorry about that - I haven't used this tool before - the correct file is now attached. Many thanks.

  8. Stefan B repo owner

    No worries. Frome the looks of it it is not a relative focuser, so I’m confused as to why this behavior happens. We will check further

  9. Stefan B repo owner

    Hi,
    i still have not found the reason of this behavior. However I have added another log that might be helpful. Can you please update to 1.10 HF2 Beta2, set your log level to debug, connect to the focuser and attach the log file please?

    Thanks.

  10. David Banks reporter

    @Stefan B I have installed the suggested Beta prog and set the log level as requested. I have connected the focuser - it reported the incorrect figures - disconnected it - reconnected it and it reported the correct figures - then disconnected it. I ran this twice to make sure it is still repeatable - the two logs are attached. Many thanks for your help in this. I am away now and without comms for 3 days.

  11. Stefan B repo owner

    Ok this is unfortunately what i was expecting to see.

    The focuser tells NINA on first connection that it is a relative focuser, so we prepare our wrapper to handle relative focuers by assuming an arbitrary position of 5000 (as relative focusers don’t report a position)
    After disconnection and reconnection the driver suddenly reports itself to be an Absolute Focuser and therefore it is working as expected.

    From what i can see there is not much in NINA to prevent this, as this looks like a weird driver issue and would need a fix on the ASCOM driver side…

    See the log extraction below.

    [2020-11-01T19:46:01.5353]   [DEBUG]     [MemberName] GetFocuser
    [2020-11-01T19:46:01.5353]   [DEBUG]     [FileName] E:\Projects\nina\NINA\Model\MyFocuser\AscomFocuserProvider.cs
    [2020-11-01T19:46:01.5353]   [DEBUG]     [Message] Relative ASCOM Focuser detected ASCOM.LakesideAstroV2.Focuser
    
    [2020-11-01T19:46:13.6499]   [INFO]      [MemberName] Disconnect
    [2020-11-01T19:46:13.6499]   [INFO]      [FileName] E:\Projects\nina\NINA\ViewModel\Equipment\Focuser\FocuserVM.cs
    [2020-11-01T19:46:13.6499]   [INFO]      [Message] Disconnected Focuser
    
    [2020-11-01T19:46:13.7648]   [DEBUG]     [MemberName] GetFocuser
    [2020-11-01T19:46:13.7648]   [DEBUG]     [FileName] E:\Projects\nina\NINA\Model\MyFocuser\AscomFocuserProvider.cs
    [2020-11-01T19:46:13.7648]   [DEBUG]     [Message] Absolute ASCOM Focuser detected ASCOM.LakesideAstroV2.Focuser
    

  12. David Banks reporter

    @Stefan B Many thanks for this. I will pass this info on to the Lakeside devs and see if they are able to help. I will let you know the outcome in case someone else has this same issue. Many thanks for your assistance.

  13. Stefan B repo owner

    It could just be a timing problem. Maybe this driver needs to be connected first to be able to read out that flag. I will talk to the contributor who added the relative focuser implementation to see if we could just first connect, then read the flag and see if that is the solution to the problem. Just looking at the ascom specification it is not clear that this order of operations is required and it works with other focusers just fine…

  14. David Banks reporter

    Thanks Stefan. I am away for a few days now so I will leave it in your capable hands. many, many thanks. David

  15. Stefan B repo owner

    I have just uploaded 1.10 HF2 Beta3 with the potential change that could fix the issue. Please try it out if it works 🙂

  16. David Banks reporter

    Thanks Stefan. I will try it when I get home tomorrow evening and let you know what happens. All the best and fingers crossed!!

  17. Log in to comment