Telescope software

I had to write the telescope software from scratch. My scope computer was a mini LPC-100 from Stealth.com. It ran win7 and I programmed it in Visual Basic (VB). Win7 was not a realtime operating system, typically needed for machine control, but it was fast enough that the OS interruptions were not a problem for this modest telescope.

VB provided a 16Hz interrupt (time tick) and here was what happened at each interrupt:

1) These time ticks maintained my own internal software clocks, and my first task was the calculation of local sidereal time so that I could calculate the alt/az positions of the stars when given their ra/dec coordinates. This permitted me to provide a 'goto' capability which was essential for a 4-axis scope that hops about all over the sky. I use UTC as my primary time reference, and I regularly updated the computer clock by comparisons to NIST clocks via browsers. I used current star catalogs to find Tycho's stars, which I then measured using my own methods. Tycho knew the nighttime sky and could see thousands of stars from his location by eye. I could see only a few tens of stars by eye from my site.

2) Next was the reading of all the encoders to find the position of each of the four axes. Because the encoders were incremental, an initialization step was required on each axis to establish an absolute position. This was found by commanding the axes into open-loop slow motion until an encoder internal reference point is detected. After this detection, the axis zero-points were asserted, the closed-loop motor controllers were activated, and the scope was ready to point.

3) In closed-loop mode, I would send a command to the USB4 interface box to generate a drive voltage for each axis. This D2A output was fed to a voltage controlled oscillator in the axis circuitry and a pulse stream was generated to actually drive the motor. For the DC motors (alt and az) the circuitry generated powerful 12V pulses that went directly to the motors. For the pitch/roll axes, a 5 volt pulse stream was sent to specialized chips that drove the stepper motors. There were four stepper motors operated in parallel for the roll axis, and one stepper each for pitch and vane control.

4) If the altitude of a star was to be determined, its ra/dec was converted to an instantaneous (constantly changing) alt/az and the scope slewed to bring the star into the camera field of view (FOV). A software reticle was imposed over the image and the star was guided by hand to the center position. The telescope continued to track in both alt and az, and when the az reached 180 degrees (due south), the star was on the meridian. The altitude of the star was then recorded for later analysis. The recorded altitude was almost always slightly different from the computed altitude, because of imperfections in the scope itself and because the calculated altitude did not include refraction or flexure.

5) If the separation of two stars was to be measured, then one star was treated as in the previous paragraph, but the other star had to be viewed through the pitch axis mirror. The pitch angle was a constant, but the roll angle (as well as the alt/az angles) needed to be calculated anew on each interrupt. The changing roll angle was due to the fact that, in an alt/az mount, the camera FOV is continuously rotating. It took me a while to get all these coordinates calculated correctly.

The camera FOV now saw two images, one of the field around the 'direct' star (meaning the star being tracked in alt/az), and the other of the field around the second star, now being tracked in pitch/roll. Alt, az, pitch, and roll were all now hand-adjusted to bring the two stellar images into the closest possible alignment. No reticle was needed. The separation (pitch angle) was then recorded. At the start of an observing run, the pitch was set to zero and the two images of the same star were used to establish the zero point for the pitch axis.

6) Next a log file entry was written (at 16Hz or at 1 Hz (default)) capturing the telescope particulars, the time, and any additional useful information. In addition, a second, smaller, log file was written only when a particular event occurred. The telescope log file was named 'tylogYYYY-MM-DD-SSSSS.txt' and the event file was named 'eventlogYYYY-MM-DD-SSSSS.txt', where the UT date and seconds-of-day were included in the filename. Usually, only the eventlogs were reduced, with the tylogs held for later reference as needed.


Here is a snapshot of the interface screen during a separation measurement between the Sun and Sirius:

In this snapshot you can see many things. All angles are given in degrees. In the upper half are UT time and LST (both in HHMMSS and decimal degrees), the voltage and current drawn by the scope, the ra/dec/alt/az/pitch/roll positions. On the left side is listed the positions of the Sun and Sirius, their current alt/az values, and the calculated separation angle along with the calculated roll angle.

The right lower side gives the encoder information for all the axes, along with enable and index capture (cap) status. The center lower section is my software 'paddle', where I do small incremental motions by mouse clicks as I watch the camera output.


There are miscellaneous functions such as ending the current log files and starting new ones (split log), registering new zero points as they are found (save zero), vane control, LED on/off, and autoguide. Also there are switches for raster searches for the mercury mirror reflection (Hg Search), az180 mode which freezes the az to 180 in wait for a star to pass through the center of the FOV, fast/slow log selection, track on/off, and input target list control. Note that the last 'goto' prior to moving to the Sun was a move to 'DirFOV to webcam' which pointed the scope's direct FOV towards a webcam so that I could verify that the solar filter had been positioned correctly in front of the optical path.


The scope computer was run 'headless' (no display, keyboard, or mouse) with actual control handled in my computer room two floors below in my house. I use VNC and TeamViewer for my remote desktop operation. All control of the scope and the observatory were done with four wifi connections; two for webcams, one for master relay control, and one for the computer remote desktop. The only wires that ran from the house to the scope were the 110VAC power lines.


A sample of the scope code can be found here.


Table of Contents Previous Page Next Page