The MRO Telescope Control System

The file mrotc.c is the Manastash Ridge Observatory telescope control software. To run the display properly it requires a 386 PC running at about 20 MHz. It also requires the presence of a DCX-PC100 programmable multi-function controller board with the following plug-in modules:

DCX Module Position

Module Description

1

A DCX-MC100 DC servo motor module hooked up to control the RA servo motor (ie. RA = AXIS 1).

2

A DCX-MC100 DC servo motor module hooked up to control the DEC servo motor (ie. DEC = AXIS 2).

3

A DCX-MC150 stepper motor module hooked up to control the focus stepper motor (ie. FOCUS = AXIS 3).

 

This software is designed to work with the custom interconnect board made for the MRO control system. It assumes that a serial COM port will be used to communicate with the observatory data acquisition computer (which is currently a PC running Linux). Which COM port is used can be easily set by altering the definition of the constant COMPORT in the include file "mrotc.h". It is currently set to run off of COM7 using IRQ5. The baud rate is set for 9600, 1 stop bit, no parity.

 

Serial Port Commands

There are currently 4 commands that the system will recognize through the serial port. All of the commands issued through the serial port should be ASCII strings terminated by a line feed ("\n"). The format of the serial port commands are as follows:

1) "focus\n" - This commands the tcc to return the current focus position. The focus position will be returned as a simple ASCII integer, eg.: "-2000\n" (note: tcc does not return the quotes and you do not send the quotes!)

2) "Focus 4000" - This commands the tcc to set the focus position. In this example, it will be set to 4000. There is no return from this command.

3) "Move 21.10000 -5.50000 1950.3" - This command the tcc to move the telescope to RA = 21.1 hours, DEC = -5.5 degrees, EPOCH = 1950.3 years. The tcc will precess the coordinates and do the move if possible. If there are errors with the move then the tcc will return the phrase "Move aborted.\n". Otherwise, this command will return the precessed coordinates in hexigesimal format, eg.: "21:08:17.51 -5:19:24.5 (1993.8)\n"

4) "position" - This commands the tcc to report its current position. The tcc will return the present coordinates in decimal hours, decimal degrees, and decimal years, eg.: "21.100000 -5.500000 1993.8\n"

 

DCX-100 Macros and Control Registers

This software makes extensive use of the DCX-100's macro facility. Most of the real time control of the handpaddle and focus buttons is done through the use of macros. In order to allow easy changes to critical telescope parameters, these macros use several registers which store important quantities such as the slew velocity and acceleration. The following is a list of the currently defined macros and registers along with a brief description of what each of the macros do. Most of these registers and macros are initialized or defined in the subroutine "dcxsetup()".

The control registers used by the software are given in the following table:

Register number

Quantity stored

255

RA tracking velocity

254

DEC tracking velocity

253

Scale factor for "set" velocity

252

Servo motor jog and slew velocity (both RA and DEC)

251

Focus motor jog increment

250

Expert operator flag

249

RA track direction

248

DEC track direction

246

temporary storage variable

 

The macros that are currently defined in the TCC software are given below:

Macro number

Description of function

1

Set RA axis (axis 1) to tracking. This places the motor into velocity mode, no handpaddle monitoring is done by this macro. Unfortunately, in velocity mode, the jog buttons do not function on the DCX-PC100. This is why it is necessary to monitor the jog buttons when this macro is being run.

2

Set RA axis to position mode. This macro is needed to prepare the motor to respond to requests from the handpaddle buttons. This places the motor into position mode, no handpaddle monitoring is done by this macro, but in position mode, as long as the jog functions have been turned on, the handpaddle buttons will function. Note, however that the focus buttons will not function unless monitored by the appropriate macro owing to the way the computer controls the focus.

3

Set DEC axis (axis 2) to tracking.

4

Set DEC axis to position mode.

5

Jog focus motor IN by a preset number of steps (the focus motor jog increment).

6

Jog focus motor OUT by a preset number of steps.

7

Turn on jog motions based on the status of the floor down switch and the expert operator flag. If either one of these things are nonzero, then jogging is allowed.

8

Monitor the focus jog buttons.

9

Add RA track rate to jog velocity and make this the new jog velociy, set to position mode, wait for jog motion to finish, and then reset to velocity mode. This routine is called only by the jog motion control routines (routines 13 and 14).

10

Subtract RA track rate from jog velocity and make this the new jog velocity, set to position mode, and wait for jog motion to finish. This routine is called only by the jog motion control routine 12.

11

Check for floor down and expert operator flag conditions, subtract jog velocity from RA track rate and make this the new track rate, and wait until both the W and E jog buttons are inactive. This routine is called only by the jog motion control routine 12.

12

Checks to see how large the jog velocity is relative to the RA track velocity. In turn this routine will call either macro 10 or 11.

13

Execute an East jog motion. This routine calls macros 9 or 12, depending on the direction of the RA track motion.

14

Execute a West jog motion. This routine calls macros 9 or 12, depending on the direction of the RA track motion.

15

Add DEC track rate to jog velocity and make this the new jog velociy, set to position mode, wait for jog motion to finish, and then reset to velocity mode. This routine is called only by the jog motion control routines (routines19 and 20).

16

Subtract DEC track rate from jog velocity and make this the new jog velocity, set to position mode, and wait for jog motion to finish. This routine is called only by the jog motion control routine 18.

17

Check for floor down and expert operator flag conditions, subtract jog velocity from DEC track rate and make this the new track rate, and wait until both the N and S jog buttons are inactive. This routine is called only by the jog motion control routine 18.

18

Checks to see how large the jog velocity is relative to the DEC track velocity. In turn this routine will call either macro 16 or 17.

19

Execute a North jog motion. This routine calls macros 15 or 18, depending on the direction of the DEC track motion.

20

Execute a South jog motion. This routine calls macros 15 or 18, depending on the direction of the DEC track motion.

21

Check set/slew switch setting and fix jog velocities accordingly.

22

Monitor all jog buttons (RA, DEC, & FOCUS) and the set/slew switch. This macro repeats endlessly. When any of the N,S,E, or W handpaddle buttons are pushed, the appropriate axis is taken out of tracking mode and placed into position mode. This activates the jog buttons and the telescope will then move under manual control. After the jog motion ceases, this macro restarts the tracking and continues to monitor the jog buttons. While this macro is active, the DCX-100 board will not respond to additional commands unless this macro is first stopped by running the routine dcxstop(). Note that this technique of handling the jog buttons has one minor limitation: when the telescope is tracking you cannot manually slew simultaneously in both RA and DEC. The computer controlled slews do not suffer from this same limitation.

23

Prepare the telescope for an automatic slew.

 

The RA and DEC current monitors

The hardware gives the computer the capability of monitoring the RA and DEC motor currents. The same signals that are fed to the BNCs on the control panel are inputs to two A/D converters on the DCX-100 board. The motor amps send out a voltage signal that is directly proportional to the current going into the motors. There are 0.25 volts / amp for these current monitors. This is what is read at the control panel BNCs. The A/D converters have an output that ranges from 0 to 255. It is referenced to the 5 volt supply of the computer. This means that the output of the A/D converters can be converted to amps through the motors by the following formula: amps = X * (5 / 255) / 0.25, where X is the A/D reading. The RA amp is hooked up to A/D #1 and the DEC amp is hooked up to A/D #2. You can therefore read the RA current with the DCX-100 command "TA1" and the DEC current can be read with the command "TA2". Under normal conditions, these currents are small and fluctuating. For example, while tracking, the RA motor current is typically around 0.31 amps (0.08 volts on the monitor, or 4 A/D units) and fluctuates by as much as 0.15 amps. During a slew, the current will increase up to about 3 amps (0.78 volts on the monitor, or 40 A/D units).

 

Floor Down Limit Switch

The computer does not have the capability to control the observing room floor. It does, however monitor a limit switch which tells it if the floor is all the way down. Normally, if the floor is not all the way down, the the computer will not allow any slew motions. It will allow the telescope to track with the floor up. However, this safety feature can be bypassed by using the "Expert operator" command. Use of this command requires knowledge of a password which may be obtained from the telescope engineer.