Reliable autoguide with scripts

Scripts and programs to automate Astroart
Post Reply
fabdev
Posts: 502
Joined: 03 Dec 2018, 21:43

Reliable autoguide with scripts

Post by fabdev » 03 Mar 2021, 17:59

Hello, I've been asked the most reliable way to command the full-frame autoguide from scripts and to alert the user after 3 images with autoguide lost. Here are the functions that are currently used:

This is the subroutine to start the guide:

Code: Select all

Function StartAutoGuide
 Guider.FullframeAutoguide
 guideOK = false
 for i = 1 to 20
   Pause(1)
   if Guider.AutoguideStatus = "Guiding" then
      guideOK = true
      break
   end if
 next i 
 return guideOK
End Function
and this checks the guide status:

Code: Select all

Function CheckAutoGuide
  guideOK = (Guider.AutoguideStatus = "Guiding") and (not Guider.LostStar)
  if not guideOK then 
    print "--- Guide lost ---"
    lostGuide = lostGuide + 1
    Guider.Stop
    StartAutoGuide
  end if
  if lostGuide >= lostGuideMax then
     print "--- Alert, guide lost 3 times ---"
     'System.Execute("C:\AlertSoftware.exe")
     lostGuide = 0 
  end if
  return guideOK
End Function
The "alertsoftware.exe" is an optional external program which sends an alert via SMS.

At the beginning the script initializes the variables and starts the guide:

Code: Select all

lostGuide = 0
lostGuideMax = 3

ok = StartAutoguide
if not ok then
   print "*** First autoguide failed - end ***"
   End
end if
then after each exposure the guide is checked: (the sequence is never interrupted, even if the guide fails).

Code: Select all

...
Camera.Start(expo)
Camera.Wait
...
CheckAutoguide
All this is currently used for a long sequence, without autofocus or telescope gotos. If they are needed, the autoguide should be stopped and restarted with the pair: Guider.Stop / StartAutoGuide

A usual, you can check the two functions indoor using the Simulator of the Camera, Guider and Telescope.

Post Reply