EOST Instrument Controller Users Manual

The Danbury Corporation

Gary McGrath, Bruce Truax

November 25, 1996
Last update on 4/12/01 by B. Truax


Table of Contents


Introduction

The Instrument Controller Software runs in Windows 95. It controls the operation of the Wide Field Camera shutter, the Wide Field and High Resolution Camera filter changers, and the Tertiary Servo Controller. It has a network interface that the Telescope Operator Interface (TOI) uses to send commands and receive responses. There is also a serial interface that allows communication to the Tertiary Servo Controller. The Instrument Controller has a user interface that consists of several windows which can be used for troubleshooting and system development.


System Overview

The Instrument Controller consists of a PC running Windows 95 and the Instrument Controller Software. The Controller is connected to the local network through an NE2000 ethernet card. This allows the Controller to be commanded from the Telescope Operator Interface (TOI). The controller also has a National Instruments PC-DIO-96 PC bus Digital I/O card that is used to interface to the Shutter Controller and the Filter changer insert motor controller. A National Instruments AT-232 ISA bus serial card is used to communicate with the Tertiary Controller and the Filter changer stepper motor controllers.

The software is designed to run without the need for user interaction. Although, there is a user interface that can be used for development and troubleshooting. The user interface consists of a main window that allows very basic control over the shutter, filter changer and tertiary. The view menu on the main window allows the user to open other windows that give more detailed information and allow more control over the various peripheral components. These menu items include: "Operator Interface Socket", "Tertiary Servo RS-232", "Shutter Servo", and "Filter Changer".


Tertiary Servo Communications

The Tertiary Servo Communications allows the TOI to communicate directly to the Tertiary Controller through the Instrument Controller. The Tertiary Servo Communications window allows the user to see the communications that are made between the TOI and the Tertiary Controller. The user can also type in commands that are sent directly to the Tertiary Controller. The Tertiary Servo communications window can be displayed by selecting "Tertiary Servo RS-232" from the "View" menu of the Instrument Controller main window.


WFCam Shutter Servo

The Wide Field Camera (WFCam) shutter can be controlled by sending commands from the TOI to the Instrument Controller. Alternatively, the shutter exposure can be commanded from the main window of the Instrument Controller.

The shutter window can be used to monitor and control the detailed operation of the shutter for system development and troubleshooting. There are several modes of operation available from the shutter window.

Commands can be made directly to the PC-DIO-96 digital I/O interface. This is the digital interface that connects the Shutter Controller to the Instrument Controller PC. See the National Instruments "PC-DIO-96 User Manual" for more information on this interface.

Data can be read from or written to particular addresses on the HCTL-1100 Servo Controller Chip I/O port. This chip is the heart of the Shutter Controller. See the Hewlett Packard HCTL-1100 Data sheet for more details.

Also, various HCTL-1100 registers can be directly controlled and monitored. See the Hewlett Packard HCTL-1100 Data sheet for information on control modes, register descriptions, and register addressing.

The shutter is a focal plane shutter which consists of a stainless steel web with two apertures. The large aperture was designed to be used for long exposures where the web moves and stops in the center of the aperture until the exposure is complete, it then continues in the same direction to close the shutter. The small aperture was designed for shorter exposures such that the small aperture is translated at a constant velocity across the field with the velocity chosen to provide the proper exposure. This mode of operation requires that the home position of the web be midway between the two apertures. The software then tests the exposure time and decides which mode of operation to use and therefore, which direction to move the web. After the exposure is complete the web is at one of the two ends of travel therefore the shutter needs to be "cocked" before another exposure can take place. Cocking the shutter by moving the web back to the center causes a short exposure to occur, therefore DO NOT cock the shutter until your science data has been completely transferred off the chip and then clear the CCD after the shutter is cocked.

NOTE: As the software is currently implemented, the large aperture is used for all exposure times longer than 0.5 seconds. Shorter exposures (from 0.5 down to 0.1 sec) use the small aperture and move it at a constant speed across the field. Exposures shorter than 0.1 second are not implemented at this time because the exposure accuracy degrades to unacceptable levels. If shorter inaccurate exposures are desired, modify the MIN_EXPOSURE value in c:\instrument\shutter.cfg on the instrument PC. (exposures down to 0.025 seconds could be achieved this way).


Filter Changers

Either the WFCam or HRCam filter changer is selected by pressing the "Wide Field Camera" radio button or the "High Resolution Camera" radio button from the main window. A particular filter can be selected from the Filter dialog window using one of the filter radio buttons.

The filter changer window can be used to monitor and control the detailed operation of either of the two filter changers. The filter changer window can be viewed by selecting "Filter Changer" from the "View" menu on the Instrument Controller main window. The stepper motor positions the filter insert mechanism to different filter positions. It can be moved to any particular step position by entering the position in the "Position" field and pressing the "Move" button. The insert mechanism can be commanded using the "Insert" and "Retract" radio buttons.


TOI Communications

The Telescope Operator Interface (TOI) communicates to the Instrument Controller via ethernet using the TCP/IP protocol. The Instrument Controller acts as the server and the TOI acts as the client. This means that the Instrument Controller software must be running and ready to accept a client before the TOI tries to connect. The format of the communications consists of messages which are composed of ASCII strings terminated by a Carriage Return (CR) character and an optional Line Feed character (LF). Messages are received by the Instrument Controller asynchronously. This means that characters are received one at a time while controller processing continues. If there is a delay in the transmission of a message, the Instrument Controller will not stop and wait for the remaining characters, but perform other tasks until the rest of the message arrives. Once it receives a CR character, the message is interpreted and executed. The Instrument Controller receives commands for the Tertiary Controller and passes them directly to the Tertiary Controller Serial Interface. Similarly, responses received from the Tertiary Controller are passed directly to the TOI Communications Interface. All communications that pass through the TOI Communications interface are displayed in the "Operator Interface Socket" window, which can be displayed from the "View" menu of the Instrument Controller.

TOI Commands

The following is a list of command messages that the Instrument Controller will accept and the possible responses that it will send back to the TOI client.

Tertiary Commands

TERT <tertiary servo command>

Sends the [tertiary servo command] to the Tertiary Servo serial interface. See the EOST Tertiary Servo Controller Users Manual for the commands that the TOI can send to the Tertiary Controller through the Instrument Controller.

Filter Changers

The filter change Command Syntax is:

<instrument> <command> [parameter 1] [parameter 2]

Where <instrument> is either HRCAM or WFCAM

The Commands are:

 

LOAD CASSETTE <Cassette file name> <Filter file name>

This command is needed to tell the filter changer about the cassette and the filters loaded in the cassette. The files are on the instrument PC in the same directory as the instrument software. The cassette file tells the filter changer the location of the slots and the location of the cassette load position. The filter file tells the software which cassette slots have filters and what the specifications are for the selected filter. I recommend that you have edit boxes for the filter file names so that they can be changed by the user. The default values for the files are:

HRCam

Filter File - HR_Set1.dat

Cassette File - HRCamC1.dat

WFCam

Filter File - WF_Set1.dat

Cassette File - WFCamC1.dat

After the cassette is loaded (which could take about one minute) a response will be returned. the response will contain a list of the filters and a load OK acknowledgement or a load error signal. The response will look like

SELECTED FILTER 1 EMPTY
SELECTED FILTER 2 B 450.0 100.0
SELECTED FILTER 3 V 550.0 150.0
SELECTED FILTER 4 R 650.0 175.0
SELECTED FILTER 5 I 750.0 100.0
SELECTED FILTER 6 Broadband 550.0 400.0
FILTER CASSETTE LOAD OK

or

FILTER CASSETTE LOAD ERROR: <description>

This command needs to be issued prior to any of the other changer commands or the other commands will fail.

 

SELECT FILTER <slot number 1-6 (int)>

Once a cassette has been loaded, you can issue this command to select and insert a particular filter.

After the filter has been inserted (which could take up to one minute) a response will be returned. The response will be: "FILTER SELECT OK" or "FILTER SELECT ERROR: <error description>"

FILTER? <slot number>

This command returns the description of the filter in <slot number>. This is the description from the Filter File for that particular slot.

The function will return immediately with "SELECTED FILTER: <slot (int)> <description (string)> <center wavelength (float) > <bandwidth (float)>" or "SELECTED FILTER ERROR: <Error Description>

 

UNLOAD CASSETTE

This command is used if you want to change cassettes. It will translate the current cassette to the load position. Once the cassette has been unloaded and a new cassette installed, you must issue a LOAD CASSETTE command to tell the filter changer the specifications of the new cassette and new filter set.

After the cassette has reached the load position (which could take up to one minute), a response will be returned. The response will be: "FILTER CASSETTE UNLOAD OK" or "FILTER CASSETTE UNLOAD ERROR: <error description>"

Filter Changer Error Codes

The following Error codes are produced by the filter change object

OK

1

No Error

LOCAL_ERROR

-1

General Error

DEFAULT_LOAD

100

Cassette is in default load position

CHANGER_MISMATCH

-100

The specified Cassette does not match mWhichChanger

C_FILE_ERROR

-101

There was an error opening the cassette file

F_FILE_ERROR

-102

There was an error opening the Filter File

NO_FILTER

-103

Selected Slot does not contain a filter.

NOT_INITIALIZED

-104

The changer is not fully initialized

C_FILE_READ_ERROR

-105

There was an error reading the Cassette file

F_FILE_READ_ERROR

-106

There was an error reading the filter file

D_FILE_READ_ERROR

-107

There was an error reading the default file

FILE_INCOMPLETE

-108

The file did not contain all necessary data

FILE_CONTENT_ERROR

-109

The file contained the wrong information

FILTERS_NOT_LOADED

-110

The filter file was not read

CASSETTE_FILE_NOT_READ

-111

The cassette file was not read.

CHANGE_FILTER_THREAD_SUSPENDED

-112

 

CHANGE_FILTER_THREAD_INVALID

-113

 

INSERT_FILTER_THREAD_SUSPENDED

-114

 

INSERT_FILTER_THREAD_INVALID

-115

 

RETRACT_FILTER_THREAD_SUSPENDED

-116

 

RETRACT_FILTER_THREAD_INVALID

-117

 

PREVIOUS_COMMAND_NOT_COMPLETE

-118

 

INITIALIZE_CHANGER_THREAD_SUSPENDED

-119

 

INITIALIZE_CHANGER_THREAD_INVALID

-120

 

Table 1

 

The following error codes are produced by the stepper controller object

NO_INSTRUMENT

-200

 

STEPPER_MOVE_THREAD_SUSPENDED

-201

 

STEPPER_MOVE_THREAD_INVALID

-202

 

STEPPER_INIT_THREAD_SUSPENDED

-203

 

STEPPER_INIT_THREAD_INVALID

-204

 

TO_R_MR_MSB

-205

Timed out reading move reg MSB

TO_R_MR_LSB

-206

Timed out reading move reg LSB

TO_R_DR_MSB

-207

Timed out reading direction reg MSB

TO_R_DR_LSB

-208

Timed out direction move reg LSB

TO_R_V0

-209

Timed out reading velocity reg 0

TO_R_V1

-210

Timed out reading velocity reg 1

TO_R_V2

-211

Timed out reading velocity reg 2

TO_R_FHW_LIM_MSB

-212

Timed out reading forw hard lim reg MSB

TO_R_FHW_LIM_LSB

-213

Timed out reading forw hard lim reg LSB

TO_R_RHW_LIM_MSB

-214

Timed out reading rev hard lim reg MSB

TO_R_RHW_LIM_LSB

-215

Timed out reading rev hard lim reg LSB

TO_R_MOTOR_CUM_MOVE_REG

-216

Timed out reading motor cumulative move reg

TO_R_TERM_CR

-217

Timed out reading terminating CR

Table 2

WFCam Shutter

Note that the wide field camera shutter is controlled differently than the high resolution camera shutter. The high resolution camera shutter is a leaf shutter which can be triggered to open and close with a simple TTL logic signal. The wide field shutter, on the other hand, is a focal plane type shutter and it needs to know the exposure duration in order to properly set the operating mode. The shutter will either open quickly then close quickly after [duration] seconds, or it will move at a constant velocity across the field so that each part of the field is exposed for [duration] seconds. Which method is used depends on the duration of the exposure. The sequence of operation of the shutter and CCD is as follows:

1. Cock the shutter by issuing a COCK command from the TOI to the instrument controller.

2. Flush the CCD.

3. Start the CCD integration

4. Start the Shutter Exposure by issuing the EXPOSE <duration> command to the instrument controller from the TOI.

5. Wait <duration> seconds for the shutter to close.

6. Stop CCD integration.

7. Read out the CCD.

8. Do not allow shutter to be cocked until the readout is complete.

As you can see, this requires tight coordination between the CCD controller and the TOI, so the integration of CCD tool and the TOI is critical in order to use the WFCam.

WFCAM SHUTTER EXPOSE [duration]

Immediately open the shutter on the Wide Field Camera for [duration] seconds. The EXPOSE may also return an error message. The two error messages are: SHUTTER ERROR: SHUTTER NOT COCKED and SHUTTER ERROR: EXPOSURE TIME OUT OF RANGE. If either of these two messages is received, the shutter will not perform the exposure. These messages are returned immediately, independent of the shutter exposure time. (See TOIServer.cpp)

WFCAM SHUTTER COCK

Instructs the shutter to Cock. This process takes approximately 2 seconds to complete. NOTE it is legal to issue consecutive COCK commands.

WFCAM SHUTTER ABORT

Aborts an exposure in process. The shutter is moved to the closed position and therefore must be cocked before the next exposure.

WFCAM SHUTTER PAUSE

The WFCam also offers the ability to pause and resume an exposure although with a loss in photometric accuracy. When an exposure is paused, the shutter is closed by moving back tohe cocked position. This means that the leading edge of the frame will experience a longer exposure by about 0.2 seconds for each pause/resume. If this is done once or twice in a 5 minute exposure, the difference across the aperture is insignificant for most images. The primary purpose of the pause/resume function is to allow multiple exposure frames to expedite the telescope focus procedure.

WFCAM SHUTTER RESUME

Resumes a paused exposure.

WFCAM SHUTTER TIME_REMAINING

Returns the amount of time remaining in the exposure in the form "TIME REMAINING x.xxxx"

 

Atmospheric Dispersion Compensator

NOTE: when the Instrument PC is turned on, the ADC object will be instantiated which will cause the ADC to intialize and move to the 90 degree position. This is the position where it has no effect on the incoming light. ADC will remain in this position until the ADC is turned on.

 

ADC ON

Turns on the ADC so that it can respond to ADC EL ANGLE commands. If this command is not issued at startup or after an ADC OFF command, the ADC will return an error message if the ADC EL ANGLE command is given and nothing will happen.

The only response this command will return is ADC ON OK

 

ADC OFF

Turns off the ADC's ability to respond to the ADC EL ANGLE command and moves the ADC to the initialization position so that it does not have any effect on the incoming light. This command should always be issued before powering down so that the ADC is left in the null position.

The possible responses from this command (which my take 10-15 seconds to occur) are ADC OFF OK or ADC ERROR: <error number>

 

ADC EL ANGLE <elevation angle (float)>

This command needs include the angle of the elevation axis which must be between 0 and 90 degrees. Upon reciept of this command the ADC software checks to make sure that the ADC is on, if not it will return an error. If the ADC is on, the ADC software asks the HRCam filter changer object which filter is currently inserted. If the filter description matches one of the descriptions in the FltrPoly.cfg file then the angle of the ADC will be computed and the ADC will be moved to the correct position.

This command can be issued as often as you like, but, except for very long exposures on objects away from the merdian it is probably not necessary to adjust it during an exposure. Since changing the ADC angle may (we are not sure) cause the image to walk slightly, it is recommeded that the command only be given just before an exposure.

Also, if you are focusing the telescope, make sure that the ADC is either set to the current angle or it is turned off, otherwise it could make the image worse.

There are a number of conditions which can cause errors such as the ADC being off, there being no filter inserted in the HRCam, the inserted filter description does not match one of the descriptions in the FltrPoly.cfg file. If any of these errors occurs, the ADC will remain in its current position.

The possible responses from this command (which my take 10-15 seconds to occur) are ADC EL ANGLE OK or ADC ERROR: <error number>

ADC Error Codes

The ADC error numbers are listed below. These errors are defined in the ErrCodes.h file

These first 4 errors should only be visible on the instrument PC during initialization

ADC_CONFIG_FILE_READ_ERROR

-300

ADC_POLY_FILE_READ_ERROR

-301

ADC_FILE_INCOMPLETE

-302

ADC_MEM_ALOC_ERROR

-303

Table 3

These 4 errors may be returned from OFF and EL ANGLE commands

ADC_MOTION_INCOMPLETE

-304 EL ANGLE is given before previous command completes

ADC_FILTER_NOT_FOUND

-305

ADC_EL_ANGLE_RANGE_ERROR

-306

ADC_NOT_ON

-307

Table 4