Message Boards Message Boards

Telescope Control with ASCOM platform and Wolfram Language

Posted 10 years ago
I have a telescope that I have built out of surplus components. Some of you may remember this image of M27, the famous Dumbbell Nebula, acquired my home-brew 90mm astrograph and inexpensive equatorial mount:

from my blog post on using Lucy-Richardson deconvolution to correct tracking errors in astronomical images:

Fixing Bad Astrophotography Using Mathematica 8 and Advanced Image Deconvolution

I recently upgraded to a new Losmandy G11 mount with a Gemini II controller and here I will explain how to control it with Mathematica.

Although I've used a Losmandy mount for this example, many other computerized telescope mounts can also be controlled using the ASCOM interface.

First, make sure you have the latest version of the ASCOM platform installed on your system. You can obtain it for free from here: Also make sure you have the correct drivers specific to your mount installed. Links to many popular telescope mounts can be found on the ASCOM site. Finally, this following code presumes your mount is properly set up and polar aligned.

.NET/Link installation
InstallNET["Force32Bit" -> True];

Load ASCOM Assemblies
loadASCOMNETAssembly["All"] :=
  Map["ASCOM." <> # &, {"Astrometry", "Attributes", "DriverAccess",
    "Exceptions", "Helper", "Helper2", "IConform", "Interfaces",


Load the ASCOM.DriverAccess.Telescope type so we can call the Choose static method

Working with Telescope

Choose telescope dialog
telescopeDriver = Telescope`Choose[""];

myTelescope = NETNew["ASCOM.DriverAccess.Telescope", telescopeDriver];

Telescope set up dialog (optional)

Connect to scope
myTelescope@Connected = True;

Unpark scope

Start tracking
myTelescope@Tracking = True;

Utility function for object location
 SlewToObject[telescope_, object_String] :=
  Module[{ra, dec},
   Speak["Looking up coordinates for " <> object];
   ra = AstronomicalData[object, {"RightAscension", DateList[]},
     TimeZone -> $TimeZone];
   dec = AstronomicalData[object, {"Declination", DateList[]},
     TimeZone -> $TimeZone];
   Speak["Slewing to " <> object];
   telescope@SlewToCoordinates[ra, dec];

Slew to some objects
 SlewToObject[myTelescope, "Mizar"]
 SlewToObject[myTelescope, "Arcturus"]
 SlewToObject[myTelescope, "M81"]
 SlewToObject[myTelescope, "M82"]
 SlewToObject[myTelescope, "Alkaid"]

SlewToObject[myTelescope, "M42"]

Park scope

Disconnect from scope
myTelescope@Connected = False;
POSTED BY: Tom Sherlock

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract