System to ensure best autofocus

Issue #71 resolved
Former user created an issue

In some systems the backlash is so large that returning to best focus Position after autofocus simply will not work. A system could be implemented to ensure that the focuser returns to the correct focus point, so that backlash is no longer an issue.

Comments (13)

  1. Stanley Dimant

    Current idea of implementation:

    • 2 settings for focuser: inwards and outwards backlash compensation in steps
    • A button to calibrate the compensation in AutoFocus Tool in Imaging
    • Routine: 1. move focuser 100 steps out, take HFR (initial HFR) 2. move focuser 100 steps out 3. move focuser 100 steps in, take HFR (temp HFR) 4. move in every 5 steps until temp HFR is within 5-10% of initial HFR 5. difference between last position and first position is inwards backlash 6. Repeat for outwards backlash
    • Last focuser movement direction is stored in FocuserVM
    • On switching directions the software backlash is added to the next move depending on direction
  2. nickstarboy

    Hi! Experienced imager, new NINA user, generally very happy. However my focuser has a well known backlash value (20 steps) which I would dearly like to enter into NINA - at present it does not return to the best position following the V curve routine. Could this be implemented? I dont need NINA to calculate this value!

  3. nickstarboy

    Builds #14 and #15 crash with “insufficient memory to continue the execution of the program” messages when focus routine is run, after a couple of frames have been acquired. #13 seems fine.

    I would love to have the option to use a central ROI, and also ideally(!) the option to bin 2x, for the autofocus routine. I wonder if these would help with the memory issues if the large frame size (4500x3200) is an issue.

    I notice NINA is using 600-800MB of memory in normal operation, FWIW!

    Thanks again for the excellent software.

    Search Results

    Videos

  4. Yannick Dutertre

    @nickstarboy Working on a fix for this. For the moment:

    1. If you can, use the x64 version
    2. If not possible, disable Unlinked Stretch in the Imaging options

    Otherwise, on ROI, I have just built something to do that, have a pull request. If it gets accepted, it will probably be in the next nightly.

    As for binning, yes that would be nice to have too.

  5. Yannick Dutertre

    New idea on implementation:

    Doing very small focuser movements can trigger very small changes in HFR, themselves affected by seeing and potentially having a fairly high standard dev => when slowly reaching back for the original HFR value, the measurement is very error prone.

    Instead, use the following assumption: far enough from focus, three points taken at equidistant focus points f0, f1, and f2 should be on a line (V curve). If measuring the IN backlash, we can:

    • start at best focus (after an AF routine)
    • Move out by a sufficient number of steps, get to f2, and measure hfr2. In this method, using the options tab StepSize * Offset * 2 (or 1.5) is enough.
    • Move in by a certain step size S (can use the focuser settings step size, which we know changes the HFR enough), get to f1, and measure hfr1. If hfr1 and hfr2 are very close, backlash is not cleared yet, and repeat (move in by S, measure and replace hfr1). Remember the number of times the measurement is done (counter C), to a maximum of 3 times
    • Move in by S again, get to f0, and measure hfr0
    • Compute the slope between f2 and f1 as measuredSlope = (hfr2 - hfr1) / (C * S)
    • Compute the slope between f0 and f1 as idealSlope = (hfr1 - hfr0) / S
    • If abs(measuredSlope) > abs(idealSlope), there is no significant backlash
    • Else, Backlash In is (1- measuredSlope / idealSlope) * S * C

    I have sample code for that in NINA, will test it once skies clear.

  6. nickstarboy

    Sounds great for users with no known value for their backlash. For myself I would prefer to simply enter the value of 20 steps into NINA and use that. Thanks for the ongoing work!

  7. Yannick Dutertre

    @nickstarboy Yep! You can already do that in the latest nightlies, but with that measurement people will be able to let NINA decide what the values should be 🙂

  8. nickstarboy

    Aha Yannick thats great! My apologies, havent had a night to try the latest version for a couple of weeks. Great news anyway, will let you know how it works. Cheers!

  9. nickstarboy

    Yannick - all working well. Having to use 32 bit as my focuser driver is 32 bit only but thats fine. The backlash parameters - are they in native focuser steps (ie the same units as ‘auto focus step size’) or multiples of this, as in ‘auto focus initial offset steps’. I wonder if it might be clearer if these werent both referred to as ‘steps’ when one is a multiple of the other? I know I should be able to figure this out but Im verytired….!!!! Thanks again for all your work.

  10. Log in to comment