I'm guessing you mean the backlash field in Focus (or in Indi on the focuser tab)?

There is a check in focus that the backlash field is activated if the focuser supports backlash and inactive otherwise. I had a quick look at the moonlight driver and it looks like it doesn't support backlash (although I'm not an expert here so could be wrong). I don't know if that is because the focuser doesn't support backlash or a limitation in the driver.

This would be consistent with you seeing that the field is inactive.

Focus should work fine with the 5 * Initial Step Size but will be a few seconds slower due to the "unnecessary" in/out focus movement. The "5" is hardcoded in the program so, at the moment, the only way to change it would be to build you own version of kstars.

Just out of interest what would you want to set it to?


John replied to the topic 'KStars crash during focusing' in the forum. 5 days ago

There's nothing obvious that I can see in the log. You have focus, scheduler, capture and guiding all active at around the time. These segfaults are hard to diagnose unless you can catch where it is in debug at the time. I run focus at bin 2 but usually capture at bin 1 so if this is related to the problem it must be an edge case. Still, if you think its related you could try focus at bin 1 and see if you still get the issue.

Worth putting verbose mode on in the logging for the active modules to see if you can capture any more clues, and consider running kstars under some form of debugger (if you are able to).


John replied to the topic 'Starting point using ASI EAF?' in the forum. 6 days ago

Hi Håkan,
The focus section of the kstars handbook is a good place to start...


John replied to the topic 'Auto Focus failures' in the forum. 1 week ago

Oh, nice. That should be great! I'm really interested to see some focus images. I can run them through star extraction. I have been doing some research to try to improve star detection with SEP so if this turns out to be a problem then I might be able to help a bit.


John replied to the topic 'Auto Focus failures' in the forum. 1 week ago

The software handles the backlash compensation. The exposure of backlash on the Mechanics tab is a convenience to avoid having to use the indi tab (both are kept in sync).

For L1P it works as follows:

Backlash: All mechanical devices with gears suffer from backlash. In a typical focuser there will be a dead zone where changing direction (e.g. from “in” to “out”) results in movement of the focuser by a few ticks, but no actual movement of the optical train.

The Linear 1 Pass algorithm (like the Linear algorithm) provides backlash compensation in the 2 places during an auto focus run when the focuser moves outwards:

The initial outward movement of Initial Step Size * Out Step Multiple at the start of the run.

When the inward pass is complete and Ekos has determined the best focus position and moves outward to it.

Linear 1 Pass will extend (by x ticks) the outward movement, and then, as a separate movement it will move inward by x ticks. So it always approaches the desired position in an inward direction.

There are 2 schemes that can be used:

Set Backlash to 0. Ekos will use a value of 5 * Initial Step Size.

Set Backlash > 0. EKOS will use this value in its backlash calculations. There will probably be instructions with your focuser for determining the value of Backlash. It is not necessary to set an exact value for either Linear or Linear 1 Pass to work correctly; all that is required is that the value set in Backlash is >= the actual backlash value. For example, if you measure backlash and get a value around 100, any value >=100 will work equally well. For example, set Backlash = 200.


John replied to the topic 'Auto Focus failures' in the forum. 1 week ago

So the Max Travel is there to protect the focuser from moving beyond its bounds and damaging itself. So I would set it high enough that it doesn't get "in the way" of an autofocus run otherwise you'll get compromised (=poor) results. Focus will persevere and try to do its best but the constraint is just unnecessary. As a guide set it to at least 2 * number steps * initial step size. Personally, I set mine way above this so I know it won't compromise the autofocus run.

I would always start focusing from near to focus. You can do this quite easily manually or get close enough and do an autofocus run and then that's the start point for the night.

As far as the 5s guide exposure I don't know what's going on there. Sounds strange. I was messaging Jasem earlier and he confirmed that setting ZWO CCD driver in the Indi profile would handle both cameras (which is what I do BTW). Have you got the latest version of the driver?

Happy to take a look at your focus pictures when you next try things. I'm guessing you have a scope with a central obstruction, hence the tricky situation with out of focus stars.


John replied to the topic 'Auto Focus failures' in the forum. 1 week ago

Hi David,

I had a quick look at the log...
Starting focus with Detection: "SEP" Algorithm: "Linear 1 Pass" Box size: 64 Subframe: no Autostar: yes Full frame: yes [ 5 %, 60 %] Step Size: 50 Threshold: 150 Gaussian Sigma: 1.5 Gaussian Kernel size: 5 Multi row average: 3 Tolerance: 1 Frames: 1 Maximum Travel: 200 Curve Fit: "Parabola" Use Weights: no R2 Limit: 0

A couple of things jump out at me.
1. Max Travel set to 200. Why is this so low? You are constraining the autofocus run. I would set it to 2000 (unless that gives you other issues). If the run is constrained then you won't get a proper curve. I also see log failures due to this.
2. Use weights = no. I would recommend setting this to yes.

If you send me a couple of focus frames (1 in focus, 1 as far out of focus as the autorun takes things) then I'll take a look at these. Be good if you can screenshot the SEP profile options you are using as well.



John replied to the topic 'Linear 1 Pass focussing problem' in the forum. 1 week ago

Hi David,

This is the option to check to save the focus images...

Would be helpful so see some images of the v-curve. In order to focus you need to defocus enough to get a decent v-curve but not too much so that the stars disappear or deform so much as to give false readings. Its not possible to say how much this is, that would cover all the equipment possibilities, so you have to experiment.

I'm not aware of documentation for the simulators unfortunately so you have to play around or look at the code. You can for example, replay focus images previously stored in order to test out different star detection parameters.

Good luck!


I see. I think if moving 50 steps is unpredictable (backlash aside) then you're going to struggle with autofocus in general, as all the algorithms assume some sort of predictability in the focuser. Maybe somebody else on here with an Olympus may have some tricks.

You can control the backlash movement by setting the backlash amount. When changing direction, the focuser will add this to the previously calculated movement. So you try playing around with this.

That said... what you were initially trying, the Linear algorithm, might be your best hope as it uses heuristics on the second past to try to stop at the best place rather than moving straight to a pre-calculated point.

Good luck!


Hi Abe,

Welcome to Ekos!

It looks like you're using the Linear algorithm. What you probably want is the Linear 1 Pass algorithm. Its also worth taking a look at the focus section of the Kstars manual...

Hope this helps!


John replied to the topic 'Linear 1 Pass focussing problem' in the forum. 2 weeks ago

Yeah, that looks out of date. The link I sent you is the latest doco. The project needs more volunteers to maintain the documentation.


John replied to the topic 'Linear 1 Pass focussing problem' in the forum. 2 weeks ago

I am still a bit woolly on focus failure. I have seen focusing repeat another pass, I guess its failed and trying for a second or third time. I am trying to run imaging as Jobs so will try and work out what the job does if focusing returns control. There are limits that can be set in the capture sequence and maybe some in the job so need to study this.

The Linear algorithm makes 2 passes, the Linear 1 Pass algorithm makes 1.

A good way to get familiar with this is to setup the simulators and practice focusing with these rather than wasting imaging time. If you configure the telescope simulator, focuser simulator, CCD simulator and Filter Wheel simulator you can try out whatever you want. For example, if you set the focus annulus to 50 : 50 you will simulate zero stars (like cloud cover) and see how the system behaves with retries etc. So you can get the options you want and then set the options on your real rig.

Thanks for the OAG explanation. I hadn't picked that up. The EKOS documentation takes a slightly different approach:
Suspend Guiding: Suspend Guiding while autofocus in progress. If the focus process can disrupt the guide star (e.g. when using Integrated Guide Port IGP whereas the guider is physically attached to the primary CCD), then it is recommended to enable this option. When using Off-Axis guider, then this option is not necessary.

I updated this section in the manual - are you looking at the latest version?

Would be handy if Dialog label or hint text gave a clearer explanation. Suspend Guiding option box not ticked and greyed out if using a guide scope or allow suspend guiding to work with a guide scope and let the user make the call. It's a confusing dialog if nothing happens when clicking this option.

I agree. I don't know why it was done like this.


John replied to the topic 'Linear 1 Pass focussing problem' in the forum. 2 weeks ago


Answers below…

When you have varying amount of cloud during the focusing exposures, does the algorithm in some way compensate for this or do we expect the points to be scattered further from the best fit curve? When I say compensate, are the hfr values adjusted to a mean sky background using photometric methods? In short can we expect focusing to work during the passage of high cloud (when varying but sufficient stars detected)?

Generally cloud will cause problems. Although SEP background subtracts object flux as part of its processing you will unreliable results when it’s cloudy.

Turn guiding off whilst focusing in the focusing module doesn't work. I watched the clouds pass by in the guiding module whilst focusing was happening but guiding continued. Without testing I am not sure I want to turn guiding off anyway but none the less it should work?

The idea is that if you have a separate guide scope then no need to turn guiding off. If you have an OAG then it will move out of focus and potentially cause guiding issues, hence the option to suspend guiding. The option checks that the imaging and guiding scopes that you setup in Ekos are the same. If not, it will not suspend guiding, even if option checked.

During a passage of time when cloud prevents sufficient stars to be detected, focusing fails and focuser is put back to last known focused position, what happens next? Does the mount continue to track with image capture suspended? Does the focus module pause for a short while then attempt a further focus repeating focus attempts until either sky clears sufficiently for a successful focus or job end condition is reached.?

When focus fails it retries. On 3 fails it returns control. If you run focus from the GUI then you have control. If it’s running from the scheduler then the scheduler has control. It usually will just retry focus again.

Usually, when focus is running, tracking is running, capture is suspended and guiding may be suspended (see above).

Hope this helps.