Hi,
I went a long path down to achieve the best focus I can get from my setups with various rack and pinion focusers equiped with lacerta MFOC or Primaluce Sestosenso electronic step motors in combination with NINA autofocus. As I found that there was a lot of beliefs that were not consistent with real numbers I thought it was worth to share what I found to be true and the way I take into account the various parameters (namely backlash in, BLI, backlash out BLO, step in and step out) to get the best reproductible autofocus routine in NINA down to less than a few microns (and most of the time around 1) from start position to last position assuming that start position was at the best focus point.
This post is a long one to share good explanations, I hope. There is a little spreadsheet attached that is described in the post. It helps to run the measurement phase and compute the right value and to check the consistency of the result with NINA and tune if eventually.
Looking for best focus position is worth the effort as the critical focus zone can be very tiny (see https://www.innovationsforesight.com/how-much-focus-error-is-too-much/) especially for fast scope ≤F4.
What I was looking for was a NINA autofocus sequence with physical positions of the focuser consistent with the step position reported by NINA during an autofocus sequence starting from the initial “near to focus position” and finishing to the optimized focus position close to the start position.
My problem started when I recognized that all the focusers I had on my scopes in tandem with either Lacerta MFOC or Sesto senso from Primaluce were not mechanically perfect, with the step inward (displacement when moving in resp. out) not exactly identical to step outward, and BLI different from BLO. If you are sure (with data) that you have a perfect focuser stop reading ;-).
One often read that the best way to tune Autofocus in NINA is to use “overshoot mode” with a large number of steps and forget it. Yes, this is simple and it works but if and only if BLI=BLO and step in = step out. Otherwise there is a drift taking place that can give you less than optimal autofocus final position. With my 3 tested setups this equality assumption is wrong and using overshoot mode led to focusing error that is getting close to the CFZ and I can avoid it so why not?.
In absolute backlash compensention mode you need to tune BLin and BLout to avoid that the NINA autofocus sequence finishes with the focuser moving to a step position, computed by the fitting curve that is 10, 15 microns away from the same step position when the measure was taken at that exact position. This is deterministic and is based on the difference between BLI and BLO (and also step in to step out, we’ll speak about it later).
When you put the numbers in a spreadsheet and mimik the way NINA is working you can demonstrate it easily and measure it. By the way in absolute mode NINA is keeping track of an offset (see AbsoluteBacklashCompensationDecorator.cs in the NINA repository on Githup, it is simple and easy to understand without being a developer that I am not ;-))
To get the best that you can following my path, you need a dial indicator, preferably to the micron, at least to the 100th of millimiter or 10 micron precision.
You need to fix the dial indicator to a fixed part of your setup and to have the tip of the needle of the indicator leaning on a moving part of the imaging train while the needle stays parallel to the optical axis of the focuser ie the indicator will show in microns or 10 microns how much the focuser moved after each “move to” order. Check that the moving needle of the dial indicator will never touch anything else or be jammed in its travel.
You start at the last best focus position you were at (better because the mechanical behaviour is not always the same regarding the position of the focuser).
Then you run two series of measurements and fill the little spreadsheet attached.
The first run of measurement will give you stepin, stepout, Blin and Blout. You either use the app of your focuser without any backlash settings or NINA but you need to have no backlash parameters configured otherwise it doesn’t work. You start from the start position (= last best focus position) with the backlash out cleared and you move outwards by a large amount, once or twice. You then reverse to move in and you move in a second time then you reverse by a larger amount and so on. You use a large amount to get a precise measurement even more if you use a dial indicator with 10 microns precision. You need a move of ~300 microns to get an error of ½ a graduation 5/300=1.7%, if you go for 600 microns you get a 0.8% error. When you reverse, it is more precise to estimate the backlash with a large move too with a little formula (in the spreadsheet) rather than moving step by step waiting for the indicator to move. Each time you move you capture in the spreadsheet the position in steps and the position in microns (pay attention to start from a medium position to avoid your dial indicator reaching the end). The spreadsheep computes and averages the 4 parameters. You will notice that it is not exactly the same each time because perfect mechanics is extremely expensive and I cannot afford thousands plus euros in a focuser ;-).
Now that you have BLin and Blout, and Stepin and Stepout. If BLin=Blout you just use overshoot mode with a value a little bit larger. If not or if you prefer to check for real during an autofocus, you choose absolute mode and you put the average of your measurement for Blin and Blout in NINA. And you start the last measurement sequence. You start from the best focus position having cleared the backash out (coming from a previous inner position). You move out the number of measurement points x the value of autofocus steps (5×40 for me), you measure the position, you then move in repeatedly 10 times (for me) x 40 steps and you measure the position at each autofocus steps with the dial indicator and then you come back to the original position in steps and you measure again.
As you populate the spreadsheet, you will see if the dial indicator is giving you symetric measurements around the best focus position, or not, and what is the delta. You can also easily check if BLin ou BLout have to be adjusted: if you detect that the step just after reversal is too large (backlash overshoot => should be decreased) or too low (backlash undershoot => should be increase). If you’ve done a good job during the measurement sequence, an ajdustment of 1 or 2 steps in the BL parameters is most probably sufficient to optimize the behavior down to 1 micron (in my case). If your dial show only 10 microns graduation you will have to estimate at least a quarter of a graduation but the MOST important is that you come back to the same position (you can take a picture) when you pass again at the starting position during the inward travel and when you come back to the starting position at the end of the autofocus sequence. If you have this behaviour you easily understand that whenever NINA computes an optimized best focus position il will move the focuser to the right place and not a shifted one.
We haven’t spoken yet of stepin and stepout. Overshoot and absolute backlash compensation are standard features of NINA and everything above can be done with the standard version. Clearly if stepin is too different from stepout (as it is the case for one of my setup), moving inward 10×50 steps will trigger a shift in physical position not seen by NINA that was too large according to my expectations and the CFZ. To take this into account I modified the AbsoluteBacklashCompensationDecorator.cs as it is the decorator keeping track during a NINA session of the offset between what shows NINA and the real step count of the focuser. I have a clone version of NINA on my computer, changed the decorator and rebuild a version of NINA that includes the ratio of stepin/stepout effect in the decorator. It works especially well on cumulative moves as one cannot move a focuser by decimal steps so it works well on autofocus sequence for my setup having a significant difference between stepin and stepout. I know that a lot of people do not like to use a non official version and you need to play a little bit to be able to build on your computer this specific version of NINA tuned to your setup. If there are some people interested I can easily explain what I did and share the decorator (mainly following step by step what is described on the github repository of NINA to build a clone).
Sorry for the long post but I prefer to give real step by step sequence to make it efficient if you are interested.
At the end in my case I have now consistent autofocus sequences with a measured precision down to the micron. If I change the imaging train and the best focus position changes I most probably will check again but once you have done it it is a matter of ½ hour during day time to check so it’s transparent regading imaging session.
I hope it can help some of you willing to get the best of their setup.
CS Frédéric