Error restarting the guider after auto focus


Every now and then, I have an issue with PHD2 losing the star after a lengthy auto focus. During the unguided autofocus, the guiding star drifts outside the search area and PHD sends a “Star lost” error. This instantly sends SGP in recovery mode. The issue is exacerbated by the fact that when recovering, SGP will restart the whole process, including the auto focus, throwing everything into an endless loop (center target -> stop guiding -> auto focus -> start guiding -> star lost -> recovery -> go to step 1).

In the attached log this happens shortly after 22:55:22. (154.6 KB)

The issue would be solved if SGP would tell PHD to acquire a guiding star every time when it restarts guiding. Asking in the PHD forum, I learned that there are more ways to programmatically stop guiding in PHD. Quoting from Andy’s answer:

It would be very useful to have SGP using always the method c.

Kind regards,


This happened to me for the first time last week. I have an STL-11000 and the slow download speeds even at 2x2 (combined with my focuser’s woes) can make for lengthy autofocus routines through no fault of SGP. However, my mount is an AP1100 with the absolute encoders so there’s no reason the guide star shouldn’t have been “close enough” when it came time to reacquire it. In fact, it has never had a problem before. The only thing that had changed was an upgrade to the latest version of PHD2. It kept selecting a guide star near the edge of the image and it then had trouble reacquiring it. Have you recently upgraded to the newest version of PHD2? If so (or even if not) was it selecting a star near the edge of the field?


I can not tell when it first happened and if it is linked to a specific version of PHD or SGP. I have seen it live happening with the actual PHD 2.6.5 and with the previous PHD 2.6.4-Dev10. My SGP is at

No, it was not at the edge of the field. The guiding star was somewhere between 1/4 and 1/3 of the corresponding side length to the edge both vertically and horizontally. I suppose these are two different reasons for the “Star lost” message but they both could benefit from SGP sending an “acquire guiding star” command when restarting guiding.

Kind regards,



Losing the guide star during the auto focus run is not something that should happen. It is possible that you could tweak your setup to avoid this:

  1. Make sure the “guide box” in PHD2 is large enough; that is, something like 32x32 pixels so that the guide star can drift a little bit but not leave the guide box.

  2. Make sure you disable guiding while auto focusing. The AF routine will really distort the size of the star that PHD2 is guiding on. Possibly enough to cause PHD2 to really have to hunt to find the centroid of the big, fuzzy star. That hunting may cause the star to leave the guide box.

  3. Even if the AF routine runs five minutes, the guide star should not be drifting that much. If the guide star is drifting out the the larger guide box, then it is possible your polar alignment is not as good as it could be and causing excessive drift during the AF procedure.

When I watch my PHD2 guiding graph at the end of an AF run, I see PHD2 pulling the guide star back to center. The graph shows the star had drifted about 5 arc seconds from center during the AF run. With two second exposures, it takes PHD2 about 10 seconds for the guide star to stabilize at its original guide position.


You are certainly right, it should not happen, but it does. The small change in the stop/start guiding procedure I am proposing would make the process more robust and, as far as I know, would not have negative side effects.

Kind regards,


We thought about this route when doing some of the initial PHD2 implementation but decided against it. The issue is that when you do a complete restart on guiding is that your lock position changes and it could add up to a significant amount of drift over multiple frames. Using A or B keeps the same lock position and will re-center the star between frames, minimizing drift.

Using method C would allow your frame to drift while not guiding and if the drift is significant and in the same direction you could end up with your target shifted significantly.

What may be an intermediary would be to go to method C if restarting failed rather than triggering a full recovery.



That would be perfect!

Kind regards,