Autofocus not syncing with focuser

I tired for the first time to use my lakeside autofocuser to run an autofocus routine. It doesn’t seem to want to sync its position with SGPro.
When I open the focus tab on the control panel, it states ‘current position 0’ when the focuser itself is displaying its true position on its display. And when I run autofocus, I get an error message saying ‘current focuser position does not support required range. Currently at 0 and needs to move inwards by 30’

Some guidance would be very welcome.

Thanks very much.

The log file reported this:
[19/04/2014 00:12:12] [DEBUG] [CP Update Thread] ASCOM Focuser: Error in GetCurrentPosition. : Exception has been thrown by the target of an invocation. (System.InvalidOperationException: The port is closed.)
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at SequenceGenerator.SafeFocuser.get_Position()
at at.GetCurrentPosition(Boolean force)

[Apologies for pasting the log file here. As a newbie on here, it might be useful to have some instructions on where to post log files or what to do (that is if it’s not a good thing to paste them here).]

Please post your full log file to Dropbox or a similar file service. Also, please ensure that your lakeside drivers are up to date.


Here’s the full log file. The drivers are bang up to date. Thanks.


SGPro, seems like it unable to query your focuser for position (or anything else for that matter). For some reason it just errors out with “The port is closed”. To me this indicates that the driver does not think the connection to the focuser is valid any longer. So…

  1. How is your controller connected?
  2. If it is connected via a usb hub, is the hub powered?
  3. Is the behavior the same when the focuser is attached directly to a usb port on your machine?
  4. Do you have any other software that can connect to your focsuer to see how it behaves?

I don’t know how much assistance we can provide here… we don’t have a Lakeside focuser to test with (more importantly we have no control over the driver). The code SGPro uses to communicate with focus controls is fairly well tested and pretty standard so this is likely a hardware configuration issue, a driver corruption issue or a failure of the driver to protect itself in a multi-threaded environment (although SGPro is pretty gentle of focusers these days).

Hi Ken,
1&2 - powered USB hub.
3&4 - I didn’t try connecting directly straight to the USB port. I can do tomorrow but I don’t think it’s a port issue. The focuser was connected via the hub and controlled by Lakeside’s own controller and it behaved impeccably - the ASCOM driver recognised exactly its position, it’s just SGPro wouldn’t. I turned Lakesides’s own controller off when running SGPro, and connected to SGPro independently.
I’ll pass on your comments to Lakeside, but please let me know if you have any further thoughts.
As you probably saw, I am using a DSLR at the moment, but autofocus should work with that, shouldn’t it?
Thank you for the speedy response.

Hi Kit

I know it isn’t directly of help, but I have a Lakeside auto focuser and it works fine with SGPro. Whenever, I update SGPro I have to re-set the port number in the Focus configuration, close SGPro and then re-open and all works fine.

I also make sure that I’ve manually calibrated the Lakeside to the focuser on particular scope whenever I swap set ups. I once accidentally set the step size in the control box to zero and spent a fruitless hour trying to figure out why the focuser wouldn’t move! So I’m sure you will get it to work, Ken & Jared will do their best to help. Together, SGPro and the Lakeside, are great for autofocusing.

Like you I have a powered hub - could your problem be related to your serial to usb converter and its drivers? I have read issues with particular drivers conflicting with W7 and W8. I have a ‘Plugable’ one, seems to work fine.



Hi Barry,

Thanks for the info. I think the problem has fixed itself. I contacted Peter (Lakeside) who was on hand to look into it. When I fired it up again (and switched the focuser on and off again) it all seemed to sync perfectly.

The support from both lakeside and SG Pro has been fantastic and I’d recommend either to anyone !



Hi Barry,

I also have a Lakeside focuser and it works well with SGP. Out of interest, what step size do you set for the autofocus routine.? I have mine set at 10 but this does not always give a good V curve.



Hi Roger

I spent some time experimenting to get a better focus back in January after Olly Penrice give me some excellent comments/criticism on SGL and found I had to make a number of changes to improve my focus.

I have two imaging scopes - an 80mm and a 132mm, both refractors - and each requires different AF parameters to produce a good v-curve. After reading some AF threads on the previous SGPro forum at the time, I changed from focusing using 1x1 binning to a binning above my imaging binning, i.e. 2x2 if I’m imaging unbinned, this is discussed in the SGPro manual I think.

I also calculated the critical focus zone for each refractor using the formula in the Wilmslow Astro web page and experimented with the step size (9, I seem to recall, for the 80mm) but found that the curve wasn’t consistent between filters nor was each side of the curve steep enough. (Despite the claims of Baader, I have found my LRGB and NB filters to not be par focal, close, but not quite.) I recall that Jared said that the new algorithm used for the AF routine was very robust, and increasing the step size to 25 for my 80mm and 30 for the 132mm using 9 AF points gives me quite symmetrical v-curves and always triggers the ‘green’ regression algorithm to calculate the focus point. The 9 points also ensure that I have enough steps either side of a particular filter’s critical focus (e.g. R) to ensure that the next filter in my sequence (e.g. G) will have the ‘v’ of its v-curve within the graphing space. So I found that the step size is dependent on your scope (no surprise there I guess!).

At first, after increasing the step size as above, I found the right-hand side of each v-curve was distorted with the second AF HFR reading being larger than the first. I then set the backlash compensation to the same value as the step size and IN, and this corrected the distortion.

I have also experimented with the sub length and find that 10 seconds for LRGB and 45 seconds for NB works well to give a sufficient number and saturation of stars for consistent HFR measurements between subs.

Finally, I also exclude the outer 5% of the image frame for the HFR measurements - I think that makes a small difference for the very slight elongation of the stars in the corner (I’m still tweaking spacing to flatten my field).




I forgot to mention, after increasing the step size as above, at first I was not confident that the step size would calculate the critical focus as the size was much larger than that calculated using the formula on the Wilmslow Astro web page. So I noted the focus point using both the larger size (25 for the 80mm) and smaller (9 for the calculated value) and both gave the same focus point. That gave me confidence in SGPro’s AF algorithm.

Best wishes,


Hi Barry,

Thanks for that. Your advice was really helpful. Now I just need a clear night to try it out on.



No problem. Good luck with the clear skies!



Can you share the link on SGL?


Nothing of great interest I’m afraid, Olly didn’t reveal any of his secrets (I wish!).
He asked me straight whether I thought I had the best focus on my target - it was an Ha rendition of the Flaming Star Nebula. My focus was soft, although sky transparency was relatively poor, I really needed an experienced eye to challenge me and say . . . "could you do better?"
Afterwards I started to experiment and improve my technique. I started to re-focus for every sub as a starter, and then went on to refine my settings as above.