|< Control Software ]|
TopBox2 ASCOM Filter Wheel Driver
The control modes described in the previous section give direct access to the TopBox filter wheels, autoguider positioner, and focuser for testing and adjustment. For routine automated operation of the observatory the TopBox is controlled by an ASCOM Filter Wheel driver for MaxImDL.
The driver is a Windows DLL assembled in Microsoft Visual Basic 2010 Express
Edition (free software including Microsoft .NET Framework 4) as a Visual Basic
Solution and Project created by a template included in the
ASCOM Platform Version 5.5 (also free software), with additions from the ASCOM
software developer kit (SDK). Within the structure of the ASCOM IFilterWheel
interface template, the filter wheels are controlled by an ASCII dialog with
the motor controllers over a serial interface, using the ASCOM Serial Helper
Utilities. The current TopBox2 Solution (Version 2.9.0,
In ASCOM teminology, this driver is a .NET assembly (dll). It is an "in-process driver," as opposed to a "local server," and it implements a master interface for early binding by clients. The driver was compiled for .NET Framework 3.5 because that is the standard for the ASCOM Platform Version 5.5 running on the control computer.
The driver may be installed on the RRRT PC by running the installer program
"TopBox2.9Setup.exe" generated by Inno Setup (another free software package)
according to the ASCOM SDK instructions. An uninstaller will be created in the
Autoguider Automation Strategy
The source code for the TopBox driver is based on the framework of the standard ASCOM5.5 Filter Wheel Driver, but it also includes automation functions to search the GSC for a suitable guide star when ACP starts a new target, then move the autoguider into position and adjust the autoguider camera focus. This required embedding the additional functionality within the standard Filter Wheel methods and procedures defined by the ASCOM Platform so the driver could be recognized as an ASCOM Filter Wheel Driver conforming to the programming model used by the software system that controls the RRRT Observatory.
This simple-minded approach was chosen for compatibility with the existing standardized structure of the ASCOM Platform Version 5.5, which has no specification for an autoguider interface. To design a complete software module with graphical controls and status indicators for the autoguider was beyond the scope of the project and the programmer, especially in light of the ASCOM requirements that the driver must never extend the standard interface and the driver must never display a modal window which requires user interaction to dismiss. As a result, all the functionality of the autoguider is hidden from interaction with the user, and its operating parameters are hard-coded into the driver program. This need not be a disadvantage when an adjustment is necessary, as it is relatively easy to change a few parameters in the driver code, rebuild it with VB Express, and generate a new installer with the Inno Setup compiler.
The trigger to set the autoguider is the ACP "TargetStart" User Action found in the Windows Script Component UserActions.wsc. This is part of the ACP Custom User Actions Component Framework, which "provides ACP standard scripts with a set of user-written actions that can be performed at several points during the execution of ACP's standard scripts." If UserActions.wsc is registered (right-click popup menu on the listed file), the TargetStart function will be called when ACP is about to start a new target. The coordinates of the new target are available within that function, so the user code writes the RA and Dec to the text file C:\tarcoo.txt, where they will be available for reading by the TopBox driver. To notify the TopBox driver to set the autoguider, the TargetStart user function then makes a call to ACP's scripted Camera object asking what filter is currently in place. This produces a Get call to the Filter Wheel driver's Position property, which has been modified to test for the existence of C:\tarcoo.txt. If the file exists, the driver reads the coordinates, sets a flag, and calls the SetGuider subroutine with the coordinates of the new target.
The SetGuider subroutine of the TopBox driver begins by using the target coordinates together with the RA and Dec offset boundaries of the E and W guider fields to calculate limits for a GSC search. Since no method could be found to use existing scriptable resources of the RRRT PC to perform the search, and to avoid depending on an internet connection with the associated performance overhead, it was necessary to include a self-contained SearchGSC function in the TopBox driver code. This was accomplished by installing the Pocket Version of the Guide Star Catalog as C:\GSC_1.1 on the RRRT PC (in addition to the ACP version in C:\GSC11) and translating the accompanying search program into Visual Basic.
The SearchGSC function returns the coordinates of the brightest guide star in the search region to the calling subroutine SetGuider, which then calculates the required position of the autoguider and moves the linear actuator accordingly. The current version of the position calculation is based on experimental observations rather than the optical model described previously, and it may be refined and modified if warranted by future results, e.g. if the collimation of the pickoff mirror is improved and the guider FOV parameters are changed.
Finally, the autoguider focuser must be adjusted both for the focal plane offset of the guider position and for the current filter. The timing interaction of the imaging, filter selection, and focus control software systems for the main CCD imager makes it impossible to read the main telescope focus position for the next exposure and apply a simple calculated offset. Instead, each call to the TopBox driver to Set a new filter position initiates a check for the autoguiding flag. If the flag is set, the current autoguider position is read from a global variable, the corresponding focus setting is calculated, an offset is applied for the requested filter, and the guider focuser is moved by addressing it over an ASCOM Pipe interface acting as an independent hub for the SmartFocus driver to avoid conflicts over ownership of the SmartFocus serial port. As with the autoguider position calculation, the guider focus calculation is hard-coded based on experimental observations and may be expected to change if the pickoff collimation, the guider FOV parameters, or the position of the guider camera in its focuser drawtube are changed. Fortunately the guider focus is not at all critical because the guider camera has small pixels (7.4 μm square, giving an image scale of 0.626 arcsec/superpixel at the default 2x2 binning) and the algorithms used by MaxImDL and ACP for guide star detection and centroiding are effective even for distorted images.
Setup and Configuration
Because MaxImDL does not directly implement the ASCOM FilterWheel driver interface, filter wheel control must be configured in the MaxImDL Camera Control Setup by selecting ASCOM for filter wheel, then using the Advanced button to choose "TopBox2 FilterWheel" as the driver, then setting its Properties to use the COM port that is connected to the PC Motor Jack of the TopBox electronics rack (currently COM15). The MaxImDL Help Manual explains the convoluted procedure for setting up the DualWheels filter wheel plugin required to use the SBIG STL-1001E CCD Camera's internal filter wheel and external autoguider head with the TopBox. MaxImDL must be reconfigured in this way each time a new driver version is installed; otherwise the results may not be as expected. The SmartFocus driver on the ASCOM Pipe interface should be set up to use the COM port that is connected to the PC Focuser Jack of the TopBox electronics rack (currently COM4).
|Last modified: Nov 15, 2012 David McDavid||