The software has gone through several reincarnations, starting as 6502 assembly code for the Commodore 64, when the Commodore 64 first came out (I bought my Commodore 64 for at the time incredible sales price of $600, and with no floppy or tape drive, and had to reenter my programs everytime I turned the computer back on!). Unfortunately, the stalwart 2 megahertz 6502 processor could only muster recentering the object every couple seconds. The dream of an inexpensive amateur built altaz drive seemed far away, until the AT class machines arrived. The code was then rewritten in C. Later, the code went through its C++ object oriented life on a 386. Now, in interests of making the code as universal and easy to port, the code lives in ANSI C. Functions that are directly tied to low level hardware such as the parallel port and bios clock, use pointers to access the appropriate memory locations. For non-DOS machines, some modification of these parts of the code will be necessary.
The servo version of the software was started in May 2001.
The program is based on the popular two-star conversion algorithm, based on an Feb '89 Sky and Telescope magazine article by Toshimi Taki, to translate between altazimuth and equatorial coordinates. The scope need only be accurately aligned on two widely separated stars using a high power reticle eyepiece; there is no need to level the base. The scope can also be initially set on a planet, say, soon after sunset. After a couple of minutes of microstepping recentering, the scope is initialized on the same object again. The scope will continue to track the object, keeping it in the eyepiece field of view for an hour or two.
In addition, the program will use a third initialization point, for more accuracy than the two star initialization would otherwise give. Any of the three initialization positions can be reinitialized as often as wanted. All init positions are saved to a file for later analysis.
The conversion algorithm allows the input of mount construction errors. For instance, one altitude bearing may be a bit lower than its counterpart. Normally this would cause a pointing error, but the conversion algorithm will compensate once given the amount of the error. The program can refine the altitude angle based on the initialized positions. Per the original Taki routine, the starting azimuth can be any number. Now the starting altitude only needs to be set to within 10 degrees or so. This altitude offset algorithm was contributed by Dave Sopchak. This is the 'Z3' error (offset in elevation between the optical axis and the mechanical axis) so named by Taki. Taki's Z1 (axes non-perpendicularity) and Z2 (offset in horizon between the optical axis and the mechanical axis) errors are also calculated after at least three initializations are done.
The software is event driven by either keyboard or hand paddle input. If no events occur, then the scope moves to the current equatorial coordinates. If the coordinates remain unchanged, the scope tracks. If new coordinates are entered, the scope slews. Slews can only be interrupted by pressing or releasing a button on the handpad, and by the keyboard, and by the altitude or azimuth limits if the interrupt driven halfstepping option is turned on. Tracking should be paused if hot-keying out to another program. When the program is exited, the scope's altazimuth coordinates are saved along with any initialized positions.
The software handles backlash and handles periodic error correction, or PEC, for both axis. A 'guide' function is also included so that guiding for a minute or two nulls occasional tiny residual drift. Drift can be manually entered in both equatorial and altazimuth coordinates.
scope.exe - the executable program
*.c, *.h - source code
config.dat - the configuration file
bstars.dat, messier.dat, are object catalog files along with other *.dat files too numerous to mention
*.scr - scroll files
*.cdf – comet definition files that include comet positions and equatorial drift values
inithist.dat - a history of all initializations, in degrees (Ra, Dec, Alt, Az, Sidereal Time, reason for init)
analysis.dat - a file of recorded positions triggered by the handpaddle that is used for later mount analysis
analysis.err - errors calculated from the analysis file
altazec.dat - correction file for altitude errors vs azimuth (rocker base levelness)
altaltec.dat - correction file for altitude errors vs altitude (altitude eccentricity, tube flexure)
azazec.dat - correction file for azimuth errors vs azimuth (azimuth eccentricity)
pmc.dat - a file containing corrections used by the pointing model corrections routine
pec.dat - the file used for periodic error corrections to the motors
guidealt.dat and guideaz.dat - a record of guiding corrections
outguide.dat - list of exit positions from Project Pluto Guide
input.dat - a record of all Ra, Dec, and name, that appear in the equatorial input fields
YYMMDDa through YYMMDDz.log, ie, 000313a.log - observer's log: a copy of the input.dat file, saved at program exit
record.dat - recorded scope equatorial scope positions via the handpaddle
encoders.txt - a recording of encoder threshold violations for each session
trenc.txt - file containing encoder readings per each microstep for all windings
polealgn.txt – file containing record of polar alignment procedure results
Data object file layout (a single blank space must start each line):
Ra_hrs Ra_min Ra_sec Dec_deg Dec_min Dec_sec name or comment
12 23 14 33 53 09 test position
I have a conversion program available for the asking that will convert Megastar and Sky commander file formats to scope.exe's data file format.
For scroll file data layouts, see the webpage on operating the software - subpage scrolling.
Comet file layout (a single blank space must start each line):
Ra_hrs Ra_min Ra_sec Dec_deg Dec_min Dec_sec Drift_Ra_hrs
Drift_Ra_min Drift_Ra_sec Drift_Dec_deg Drift_Dec_min Drift_Dec_sec
name or comment
07 14 31 +23 +12 +11 +00 00 +2 -00 -00 -1 31P Schwassmann-Wach
note that drift is per hour
In detail, the sequence of events for each bios clock tick (which occurs about 18.2 times a second) is:
add equatorial drift to current
update a status field or work with the optional encoders: either a calculation or a direct write to video memory or reading the encoders or setting current coordinates to encoder coordinates,
check for keyboard event, if none,
check for handpad event, if none,
check for IACA event, if none,
check for LX200 events and process all accumulated commands since last bios clock tick, but if none,
check to see if field rotation motor needs pulsing,
then move to current equatorial coordinates by:
calculate new altazimuth coordinates based on new sidereal time that was calculated when bios clock tick occurred,
find difference between current altazimuth coordinates and newly calculated altazimuth coordinates,
find distances to move in each axis and decide between microstepping or halfstepping, if microstepping,
then check for backlash, if none,
then spread microsteps over the bios clock tick by dividing # of microsteps into MsTicksRep, the count of PWM's per bios clock tick: if microsteps exceeds MsTicksRep, then reduce # of microsteps per fullstep up to halfstep, and if necessary, halfstep pulse the motors,
continuously generate PWMs, checking for bios clock tick at end of each PWM: a PWM consists of outputting to parallel port an already calculated array of ons and offs to the stepper motors' windings,
when bios clock tick occurs, PWMs end and new sidereal time is calculated,
the field rotation motor calculations are done at the start of the microstepping function, and at the end of every PWM, a check is made to see if the field rotation motor needs pulsing,
current altazimuth coordinates updated to reflect # of microsteps that actually occurred, current altitude coordinate updated to include refraction,
current altazimuth coordinates updated to include any backlash compensations already moved,
current altazimuth coordinates updated to include PEC based on steppers rotors' position,
current altazimuth coordinates updated to include altazimuth drift,
current altazimuth coordinates updated to include any guiding motions