Union Hill Observatory
Home | History | Observatory Build | Album | Taking the pictures | Programming | Favorite Links & Guestbook
Programming

picture1.jpg
VB6 program to control the telescope

The story so far.

I've written an application in Visual Basic 6 (VB6) to control the telescope . The application works through a connection between the telescope's RS232 port, and the serial port on the laptop. 

 

The application sends commands to move the telescope North, South, East and West and allows me to select the slew speed (the speed that the telescope moves) I want. This simple movement function is important when taking images with my CCD camera since it allows me to "point & shoot" and then adjust the telscope's posistion based on the results. Additionally, I can enter requests for the telscope to point at CNGC or Messier objects, however, I noticed that it was difficult sometimes to use the keyboard, so I added a mouse based numeric "keyboard" to the screen.  I also added focusing capabilities to the application (basically creating a digital counter for the focuser).

 

I can sync to an object (tell the telescope that its on target) using the application, turn the application red (for night time viewing) and, one of its most useful features, automatically create a new directory with today's date to store the night's pictures.

 

Improvements

I'm experimenting with the use of slider bars to enable me to center an object within the field of view. The idea is that I place vertical and horizontal slider bar to the side and underneath the image. Then I move the two slider bars to the posistion of the object on the image and press "center"; the program then re-posistions the telscope so that the object of interest appears in the center of the screen.

Next steps

A problem was that I had other programs that wanted to talk to the telescope as well, but they didn't play well together when they all tried to used the same connection at the same time (parents and programmers are well aware of the conflicts and confusion this can generate!). A discusion with one of my fellow Squakers - Jonathon Fay (take a look at his site on the links page) - turned me on to ASCOM. ASCOM is an astronomy Application Program Interface (API) designed to create a standard interface to all computer enabled telescopes so that, for example, a programmer can write an application for a Meade and reasonably expect it to work with a Celestron. It also creates the idea of a hub, so that mutiple applications can talk to the telescope using the same connection, but more than that a dome control program "knows" where the telscope is pointing, this provides a simple way of co-ordinating the dome control system with the telescope - excellent stuff! 

 

Programming with ASCOM

My first impression of ASCOM is that it was designed for professional programmers with little thought given to the less experienced, and I found it difficult to follow the instructions. However after a little perserverance and some questions to ASCOM knowledgeable friends, I manged to get the ASCOM simulator to come up. This was a useful first step, since the simulator allowed me to try out the various ASCOM functions without actually hooking up to the scope.

 

I now have a program written in VB.net and  ASCOM that displays the position of the telscope in RA and Dec, as well as Altitude and Azimuth, as the telescope moves. This was done by using a timer to create an "event" every half second that interogates the telscope posistion. Additionally, I can enter a RA and Dec and ask the telescope to slew to that posistion.  I didn't find an easy way (though there might be one in ASCOM) to convert from "decimal" degrees to degrees, minutes and seconds, so I wrote a conversion routine and implemented it as a "function".  The reason I implemted the conversion routine as a function  is because I use the decimal degree to degree conversion several times in my program, and I wanted to call the same function at the appropriate point rather than duplicate the code every time.  

 

The next step will be to  integrate the capabilities of my current controlling program into my new ASCOM enabled application and add voice recognition capabilities and a feature that allows the telscope to follow the actions of a mouse (a presentation style mouse is what I have in mind) - I'll let you know how that goes...