TCS Commands

This document lists all the 4-M TCS commands that can be given through serial ports A, B and D, or via RPC connection. The commands are given as messages consisting of a command keyword and optional parameters. A message is terminated with a message delimiter, that could be a CR or LF character.

All commands returns a specific response as a numeric string, or a status of the requested operation. Normally this is the string "ok", meaning that the command was accepted and acted upon. If the operation is a motion that takes some time to complete, then the string "moving" is returned. To determine the end of the motion, you need to poll by sending again the same command but without arguments, until the string "ok" is received. An error condition is reported with a message consisting of the word 'error', followed by a number, then the character ':' and finally a short text describing the error. For example:  error 4: motion already active. Then, the possible responses to a command are:

  •  a numeric string starting with a digit or number sign (e.g. -23.5    02:34:15.9)
  •  the string "ok"
  • the string "moving"
  •  a string starting with the word "error"

The following notation is used to describe the commands syntax:

[ ]

Square brackets indicate an optional item; it is not mandatory to give that item in the command line.

ra

denotes right ascension. It is given in units of time, i.e. hours, minutes, seconds, with each number separated by colon (:). For example, 14 hours, 23 minutes, and 15.37 seconds is represented as 14:23:15.37.

dec

denotes declination. It is given in units of arc, i.e. degrees, minutes, seconds, with each number separated by colon (:). For example, 43 degrees, 57 minutes and 15 seconds south is represented as -43:57:15.

ha

denotes hour angle. It is given in units of time, i.e. hours, minutes, seconds, with each number separated by colon (:). Negative numbers mean east  while positive numbers mean west. For example, 2 hours, 15 minutes and 43 seconds east is represented as -02:15:43.

n, s, e, w

denotes the directions north, south, east, west respectively.

ra_offset:
dec_offset:

denotes right ascension and declination offset respectively. An offset is given in units of arc, i.e. degrees, minutes, seconds, with each item separated by colon (:). Alternatively, it is possible also to give a single number that is to be understood in units of seconds. An offset must also be preceded by one direction character (n, s, e, w). For example, an offset to the south of 2 minutes and 30 seconds could be given as  s 00:02:30  or  s 150.

ra_rate:
dec_rate:

rates are given in units of arc_seconds/second.

4map   command_string

With this command you send messages to the 4map PC. This PC controls  the primary mirror active support system. See the 4map manual for a description of the commands.

adc  [enable, disable, stop, calc, move]

This commands performs operations related to the Atmospheric Dispersion Corrector devices. There is one device at prime focus and another one at cass. The selection of the active one is implicit in the instrument selection: Hydra selects the cass unit. Pfccd and Mosaic selects the prime focus one. The devices are controlled by an SMC: the prime focus SMC is called "pf4m" and the cass SMC is called "cfadc". The command options are:

enable:

enables the corrector to adjust itself as the telescope moves.

disable:

disables the auto adjust option

stop:

stops the motion of the device.

calc:

calculates the position of the corrector elements. If no argument is given (i.e. adc calc) then use the present telescope hour angle and declination. Otherwise the next two arguments are taken to be the hour angle and declination (in decimal hours and degrees resp.) for the calculation. It returns a string with the calculated inner and outer positions, the zenith distance and azimuth. For example:
adc calc 2.5 -67.3
18 235 27.3 112.4

move:

moves the corrector elements to a certain angular position. If no argument is given then use the present telescope coordinates to calculate the element positions. Otherwise, the arguments are considered to be the inner and outer angle position of the corrector.

If no argument is given, the command returns a string with the inner and outer angle position of the elements. For example:

adc
27 moving

apoff ra1 dec1 ra2 dec2

Calculates apparent offsets between two mean positions. Returns ra and dec offsets in arcseconds.

base

Sets the present telescope position as base position. The base position is the reference to calculate tracking and pointing corrections. This command is executed automatically at the end of every slew.

bsw [a, b]

Performs a beamswitch offset. If the parameter is "a", then the motion is in the declared direction, as given with the command bsw_set. If the parameter is "b", then the motion is in the reverse direction. If no parameter is given, then the command returns the status of the motion. For example:

bsw a
moving
bsw
moving
.
.
.
bsw
ok

bsw_set  [ra_offset, dec_offset]

This command declares the magnitude and direction of a beamswitch offset. If no parameter is given, then returns the present values. For example:

bsw_set n 35
ok
bsw_set
N 35

clamp   n [on, off]

This command handles the comparison lamps. "n" must be 1 or 2.  For example:

clamp 1 on
ok
clamp 1
on

coords

Returns telescope information in the following order: mean ra, mean dec, hour angle, dome position, sidereal time and universal time. For example:

coords
12:27:33.4  -30:10:50  00:12:28.3  214.3  14:23:37.3  05:46:02.1

date  [date string  mm/dd/yyyy]

Sets or gets the present date. The year could be given as a 4 or 2 digits number. For example:

date  04/25/1999
ok
date
04/25/1999

dome  [enable, disable, pause, move]

This command performs operations related to the dome.

enable

enables dome to follow the telescope

disable

disable dome motions

pause n

Pause dome motion for "n" seconds

move n

Move the dome to certain angle position given by "n". If the dome is disabled, it gets enabled just for this motion. At the end of the motion the dome is always disabled. For example:

dome move 270
moving

enco

returns a string consisting of raw ha and dec derived from PMAC encoder counters and the telescope absolute encoders. For example:

enco
INC  01:23:34.5  -30:10:50       ABS  01:23:30.1  -30:10:20

epoch   [epoch_number]

Sets the epoch for coordinates display. For example:

epoch 2000.0
ok

f8sec  [tilt, absolute, absnot, atilt, afocus, focus, display, fast, slow, SMC_string]

Command to perform operations with the f8 secondary mirror. The mirror is controlled by an SMC whose name is "f8sec". It is possible to pass commands directly to the SMC, but some operations require preprocessing at the TCS level.

tilt  [tilt_distance  azimuth]

Performs a relative tilt motion of "tilt_distance" and "azimuth". The telescope performs an offset to compensate for the mirror motion. If no arguments are given then returns the 3 encoder values or the state of the motion. For example:

f8sec tilt  0.0145  87.3
moving

absolute  tilt_distance  azimuth

Performs an absolute tilt motion of "tilt_distance" and "azimuth". The telescope performs an offset to compensate for the mirror motion. You must always give arguments with this command. To check for motion completion use f8sec tilt. For example:

f8sec absolute  0.304  117.8
moving

absnot  tilt_distance  azimuth

This is the same as absolute but the telescope doesn't  move.

atilt  encoder1 encoder2 encoder3

Move the mirror to the given encoder positions. The telescope doesn't move. For example:

f8sec atilt  12345  11917  12743
moving

afocus  [focus_value]

Move the mirror to an absolute focus value. If no parameter is given then returns the present focus value or the state of the motion. For example:

f8sec  afocus 326800
moving
f8sec afocus
326800

focus  [focus_value]

Move the mirror "focus_value" units relative to the present position. If no parameter is given then returns the present focus value or the state of the motion. For example:

f8sec focus -5000
moving
f8sec focus
321800

display

Returns the present tilt and azimuth values. For example:

f8sec display
0.304  117.8

fast   [fast_speed]

Sets the fast focus speed. The default value is 50. For example:

f8sec fast 45
ok
f8sec fast
45

slow  [slow_speed]

Sets the slow focus speed. The default value is 25. For example:

f8sec slow 20
ok
f8sec slow
20

SMC_string

The string should not start with any of the keywords mentioned before. The string is passed directly to the SMC.

f14sec  [tilt, absolute, absnot, atilt, afocus, focus, display, fast, slow, SMC_string]
f14sec  [adj, go]

This command is similar to f8sec, but acts on the f14 secondary system. Two new parameters are added:

adj n

Enables (n = 1) or disables (n = 0)  the coma correction adjustment. This correction is performed at the end of a slew motion.

go

Performs the coma correction at this position.

G  ra_error  dec_error

This is the command to send guider information to the TCS. The command was imposed to us when we installed the Shectman guider. This command can only be given through serial port A. The guider errors are given as 2 digit integer numbers in units of hundreds of arcseconds, with numbers greater than 50 being negative numbers. The digits are contiguous. For example:

G1764  means 0.17" error in ra and -0.36" error in dec

gg  ra_error  dec_error

This command is used to send guider error information from the Hydra guider. The numbers are scaled by the factors introduced with the commands ggha, ggdec and ggrot (see below). The numbers are decimal numbers. For example:

gg   4.3  -1.27

ggdec  [dec_factor]

This command is used to enter a scale factor to multiply the dec guider error given with the command gg, to convert it to arcseconds. The default value is -0.05.

ggha  [ha_factor]

This command is used to enter a scale factor to multiply the ra guider error given with the command gg, to convert it to arcseconds. The default value is 0.05.

ggrot  [angle]

This command is used to enter a rotation angle, that is applied to the ra and dec guider errors given with the command gg. The default value is 0.

go_flag  n

This command enables (1) or disables (0) the TCS. This command is given automatically when the TCP user interface starts.

grot

This command returns the angle position of the instrument rotator.

guider  [enable, disable, move, stop, type, x, y, park, optical, xrate, yrate]

This command operates on the guider devices. If no parameter is given then returns the present x, y positions or the status of the motion.

enable

Enables tracking of the telescope motion. In order for this to be active, both the follow and guider switches must be on.

disable

Disables following the telescope.

move  mean_ra  mean_dec  epoch

Moves the guider probe to the given coordinates. A check is done for out of limits condition. For example:

guider move 05:27:43.3  -65:37:56  2000.0
moving

stop

Stops the guider motion. The enable condition is preserved.

type  n

Defines the type of guider to utilize. At present times the following devices are defined:

1 ---> Shectman guider
2 ---> Leaky guider
3 ---> Fast Tip-tilt guider
4 ---> Hydra guider

x  pulses

Moves the device in the x direction a certain number of pulses

y pulses

Moves the device in the y direction a certain number of pulses

park

Park the device.

optical

Moves the device to the optical axis

xrate  [rate  ramp]

Enters a new maximum rate and ramp for the device x motor. It only applies to the main Cass guider. The default values are 700 and 1000.

yrate  [rate  ramp]

Enters a new maximum rate and ramp for the device y motor. It only applies to the main Cass guider. The default values are 700 and 900.

iman  [cals, pc, star, mstar, cal, small, large, stop, camera, flat, pell, ap]

Commands for the iman system. If no argument given returns the present position bits or the state of the motion, if any. Also by sending the command twice without parameters, clears any internal state of timeout or initialization, if present.

cals

Starts a calibration sequence. The state of the camera is checked and the sequence is granted if it is on.

pc   string

Send string to iman pc and returns response from the device.

star

Starts a star sequence. The state of the camera is checked and the sequence is granted if it is on.

mstar

Performs a more star sequence. The state of the camera is checked and the sequence is granted if it is on.

cal

Moves the aperture wheel to the led or cal position.  The bit pattern sent is as follows:

PELLICLE_IN | FLAT_OUT | AP_LED | CAMERA_ON    or
PELLICLE_OUT | FLAT_OUT | AP_LED | CAMERA_ON

small

Moves the aperture wheel to the small position. The bit pattern sent is as follows:

PELLICLE_IN | FLAT_OUT | AP_SMALL | CAMERA_ON    or
PELLICLE_OUT | FLAT_OUT | AP_SMALL | CAMERA_ON

large

Moves the aperture wheel to the large position. The bit pattern sent is as follows:

PELLICLE_IN | FLAT_OUT | AP_LARGE | CAMERA_ON    or
PELLICLE_OUT | FLAT_OUT | AP_LARGE | CAMERA_ON

stop

Moves the devices to the stop or observe position. The bit pattern sent is as follows:

PELLICLE_OUT | FLAT_IN | AP_SMALL | CAMERA_OFF

camera  [on, off]

Turns the camera on or off. If no argument given, returns the present state.

flat  [in, out]

Moves the flat mirror in or out.

pell   [in, out]

Moves the pellicle in or out. The state of this selection is remembered and the bit pattern is sent according to it.

ap  [led, small, large]

Moves the aperture wheel to the led, small or large position.

index  [ra_zero, dec_zero]

Adjust the zero point of the encoders. If no argument given, the zero points are adjusted to coincide with the last slew coordinates. Otherwise, the ra_zero and dec_zero values are added to the present zero point values.

info

Returns long telescope info. The order is as follows:

date
universal time
mean ra
mean dec
epoch
hour angle
sidereal time
dome azimuth
airmass
zenith distance

For example:

info
04/23/1999  17:34:23.1  05:34:02.1  -34:43:56  2000.0 -00:30:16.1  05:04:01.1 260.0 1.015 12.5

instrument  [n]

Selects instrument configuration. The selection of the instrument also sets the foci and default guider. The present assignments are:

1 ---> F/8 spectrograph
2 ---> Irs
3 ---> Echelle
4 ---> Pfccd
5 ---> Mosaic
6 ---> Cob
7 ---> IR-F30
8 ---> Hydra

local  string

This command sends a string to serial port C where all SMC devices are connected.

mark   n  [ra_offset]  [dec_offset]

Place the current telescope position values into the mark table as item #n. There are presently 100 slots in that table. If n < 0 then return the position values as ra and dec for that entry. Optionally add the ra and dec offsets if given.

mir  [n]
mirror  [n]

Moves the rotator mirror to position n (1 to 4). If no argument given, then returns the present position or state of the motion.

move  [n]  [ra_offset]  [dec_offset]

Move the telescope to the position stored in the mark table entry #n. Optionally add the ra and dec offsets if given. If no argument is given then return the status of the operation.

muxinit

Initializes the "rot4m" SMC.

offset  [ra_offset]  [dec_offset]  [stop]

Move the telescope relative to the current position, the specified angular amounts. This is corrected by the cosine of the declination. If no arguments are given then return the status of the motion. Use the stop argument to stop the motion. For example:

offset  e 23.3  n 47.1
moving
offset
moving

pedi  [angle]

Moves the inner ADC element to the given angle.

pedo  [angle]

Moves the outer ADC element to the given angle.

planet  [ra_rate, dec_rate]

Enters telescope rates to be added to the normal tracking rate. To restore conditions, enter the command with zero rates (i.e. planet 0 0).

pointing

Returns pointing data information. The fields are:

slew ra
slew dec
raw ra
raw dec
sidereal time

raw

Returns raw and apparent coordinates. The fields are:

raw ra
raw dec
apparent ra
apparent dec

rot  [angle]

Moves the instrument rotator to the given angle.

rot4m  string

Sends "string" to the rot4m SMC.

s  [time]

This command is used to initiate or terminate the recording of tracking and guiding information. The command acts as a toggle. The optional recording time is given in units of minutes. By default the time is 10 minutes. On the TCP status display, a field flashes whenever the recording is active.

sec  [mirror n]

This is the generic command for the secondary mirror control system, being F/8 or F/14. The TCS sends the command to the appropriate SMC depending on which mirror is selected. All the parameters for the F/8 or F/14 system, could be sended with this command.

mirror n

Selects the mirror.
1 ---> F/8
2 ---> F/14

set  variable_name  [value]

This command is used to set or display  certain internal TCS variables. By giving the name of the variable, its present value gets displayed. By giving the variable name and a value, the variable gets updated with the new value.

zha : zero point hour angle in 0.1 arcseconds
zdec : zero point declination in 0.1 arcseconds
track_rate : track_rate in arcseconds/seconds
fkh : encoder pulses to arcseconds conversion factor for hour angle
fkd : encoder pulses to arcseconds conversion factor for declination
zx : guider x zero point in encoder counts
zy : guider y zero point in encoder counts
hset : set rate for hour angle in arcseconds/seconds
dset: : set rate for declination in arcseconds/seconds
hguide : guide rate for hour angle in arcseconds/seconds
dguide : guide rate for declination in arcseconds/seconds
hstep : step distance for hour angle in arcseconds
dstep : step distance for declination in arcseconds
rate_hoff : offset rate for hour angle in arcseconds/seconds
rate_doff : offset rate for declination in arcseconds/seconds
cstbl : stabilization time after offset, in 0.1 seconds
ih : index   ha pointing coefficient
id : indec dec pointing coefficient
ch : collimation pointing coefficient
np : non-perpendicularity pointing coefficient
ph11 : polinomial pointing coefficient
d4hc : declination flexure pointing coefficient
d2ds : declination gears pointing coefficient
me : polar axis elevation pointing coefficient
ma : polar axis azimuth pointing coefficient
hf : horseshoe flexure pointing coefficient
flx : tube flexure pointing coefficient
scale : telescope scale in arseconds/mm
config : telescope configuration (1 = CASS  2 = PRIME)
dome : dome flag (1 = enable  0 = disable)
guider_follow : enable (1) or disable (0) guider follow option
handpaddle : select handpaddle normal (0) or x-y (1)
cosdec : enable (1) or disable (0) the cosdec option
set : returns a string with the following information

track rate
set hour angle rate
set declination rate
guide hour angle rate
guide declination rate
offset hour angle rate
offset declination rate
step hour angle distance
step declination distance
telescope scale
go flag state
guider follow flag
handpaddle flag
track switch state
telescope configuration
dome flag
instrument
telescope focus
rotator angle

slew  [stop, white_spot, zenith, app, previous, next, coordinates]
 

Slew the telescope. The motion is activated by pressing the enable switch in the control box. If no argument is given, returns ths status of the motion.

stop

aborts the slew operation. The dome is left disabled.

white_spot  'c'

Slew to the white spot position as selected by the character 'c' : n for north or s for south.

zenith

Slew to the zenith. The dome stays at the present position and it's left disabled.

app  hour_angle   declination

Slew to an apparent place given by the hour angle and declination coordinates.

previous

Slew to the previous position stored in the coordinates stack.

next

Slew to the next position stored in the coordinates stack.

ra  dec  [epoch, pm_ra, pm_dec]

Slew to a mean position given by the coordinates. The order is right ascension, declination, epoch, proper motion ra, proper motion dec. The last three fields are optional. For example:

slew  12:27:43.2  -43:03:16  2000.0

stack  [reset, top, bottom, pointer, set, list]

This command is used to manipulate the coordinates stack. After every slew, the coordinates are store in a stack. It's possible to add more coordinates if desired. The limit is 500 coordinates. If no argument is given, returns the present stack size.

reset

Resets the stack pointer. In other words, clears the stack.

top

Moves the stack pointer to the the top position.

bottom

Moves the stack pointer to the bottom position

pointer  #n

Moves the stack poiter to the #n position.

set  ra dec epoch

Push a new coordinates set.

list  [next]

To get the coordinates stored in the stack a sequence of commands is necessary. Start by sending the command "stack list". After receiving the first coordinates keep sending the command "stack list next" until the string "end" is received.

telfocus  [focus]

Gets or sets the telescope focus. This command acts on the selected focus (F/8 or F/14). If no argument given, returns the present focus value or the status of the motion.

time  [hh:mm:ss]

Gets or sets the time.

tt   command string

Send command string to the tip-tilt control PC.

xy  [zm, zr, zx, zy, rx, ry, string]

Commands to interact with the tip-tilt camera x-y table.

zm

Sets the present position as the middle position

zr

Sets the present position as the roi position

zx

Returns the middle x position

zy

Returns the middle y position

rx
 

Returns the roi x position

ry

Returns the roi y possition

string

Any other string string is passed to the x-y SMC  ("f14fgc").