}

Introduction

This manual describes the axis controllers that are currently used on the 3.5m telescope. Much of the information also applies to the MCP used to control the SDSS 2.5m telescope.

Axis controllers move the telescope axes and instrument rotators. They execute the complete servo-feedback loop, including setting the motor current, reading various kinds of encoders and handling the limit switches.

Communications

Input and output are line-based ASCII.

Each command is echoed. A command may also produce one or more lines of data (e.g. STATUS or DRIFT) or error messages (though few commands report error messages). After all output is shown for a command, the controller outputs one "OK" to indicate that it has finished processing this command and is ready for a new command. This "OK" may appear on its own line, or at the end of the last line of output (the command echo, or data). The "OK" may be preceded by one or more spaces, and it must be preceded by at least one space if it appears at the end of a line of other data.

Commands are processed quickly, and a command may not be finished when the OK is output. For instance MOVE P or STOP can take quite awhile to execute, but the OK appears as soon as the command is started. In addition, the axis controllers never output unsolicited output. Once the OK has been output for a command, there will be no more output until a new command is run (unless the axis controller reboots). Thus one must poll for status.

Units

All of these values are floating point and a decimal point may be required for input.

  • pos = position in decimal degrees
  • vel = velocity in decimal degrees/second
  • acc = acceleration in decimal degrees/second/second
  • jer = jerk in decimal degrees/second/second/second
  • time is TAI seconds modulo one day

Commands

Commands marked with (*) are not used by the TCC. They are generally included for use by engineers, or for symmetry with other commands or controller command sets.

+ [count](*)

Increment the current position by step by count times. Count defaults to 1.

Example:

step 0.1
+ 5

Moves the position by 0.5 degrees. This is convenient for bumping a rotator's position when manually zeroing the position, such as the NA2.

See also step and -.

- [count](*)

Decrement the current position by step by count repeats. Count defaults to 1.

See also step and -.

DEBUG state

Turn on or off the controller's debug messages. Default is off. Valid values for state are off or on.

DRIFT

Causes the telescope to move at its current velocity until further notice. The command returns the following information: position, velocity, and time. DRIFT exists because precomputed slews are much easier to compute if the telescope is initially moving at constant velocity. The TCC always issues a DRIFT command (and uses the returned information as the initial path of the telescope) before computing a new slew.

Sample output:

  221.3300000    0.00000  6935.400 OK

HELP [command](*)

Alias: H and ?

Print command list, and if executed with a command, print help for that command. Not all commands have help.

ID (*)

Displays the code version and the axis ini revision number

axis code: 2009-10-16 379M, axis.ini version $Revision: 1.41 $

INIT

Alias: I

Halts the axis and does everything possible to put the controller into a known state, ready for use. This includes resetting all status bits (except for any conditions that are still valid after the INIT completes). The controller need not wait for the halt to finish before returning.

See also RESET

LOG message

log a message to syslog

MAXVEL vel (*)

Alias: MAXV

Sets the maximum allowed velocity.

MOVE

Alias: M

Stops the axis at the current position (overshoots and returns).

Flushes the command buffer of any queued MOVE pos vel time or MS.OFF time commands and leave the controller in the MS.OFF state.

MOVE pos

Alias: M

Moves to the given position.

MOVE pos vel

Alias: M

Moves along the path p(t) = pos + vel (t - tnow), where tnow = time at which you issue the command.

MOVE pos vel time

Alias: M

Specifies the final position, velocity, and time for an interpolated path details on interpolated paths. When this command is received, one of four things happens:

  • If the current time is later than the specified time then the command is rejected with an error message.
  • Else if the telescope is not following an interpolated path then it begins to follow a path interpolated between the current position, velocity, and time and the specified position, velocity, and time.
  • Else if the telescope is following an interpolated path and there is room in the motor control buffer then the command is saved in the motor control buffer until the command currently being used has "expired" (current time later than the time specified in the command currently being used). The motor control buffer can presently hold 10 interpolated-motion commands.
  • Else the command is rejected with an error message.

Once an interpolated-motion command expires, one of two things happens:

  • If there is another interpolated-motion command saved in the command buffer then the new command is executed; the interpolated path is from the position, velocity, and time of the last command to the specified position, velocity, and time.
  • Else the command buffer is empty; the telescope begins halting.

Several commands immediately supersede interpolated motion and flush the command buffer, including:

+MOVE (*)

Does nothing (a null offset).

+MOVE pos

Offsets by the given amount. See the note below on +MOVE commands.

+MOVE pos vel

Offsets by the amount p(t) = pos + vel (t - time_of_command), where time_of_command is the time at which the you issued the command. See the note below on +MOVE commands.

+MOVE pos vel time

Offsets by the amount p(t) = pos + vel (t - time). See the note below on +MOVE commands.

note on +MOVE commands

+MOVE commands are applied to all MOVE commands (all flavors) already received, including those commands still in the command buffer. +MOVE commands are NOT applied to commands received afterwards.

MS.DUMP

Displays last twenty fiducial (e.g. magnesensor) positions. All values are degrees. The edge is 0 for a rising edge, and 1 for a falling edge as the fiducial is crossed. If the correction is made, it is indicated under the correction column, and it is the average of the errors for the rising and falling edges.

Sample output:

ms.dump
          time                position    velocity   error    edge  correction
          1266860307.600     74.814029    0.241533   0.000954   1    0.000524
          1266816131.180     59.597493    1.485286  -0.003319   0    0.000000
          1266816131.330     59.819334    1.485286  -0.000797   1   -0.002057
          1266839360.530     59.810348   -1.376835   0.006240   0    0.000000
          1266839360.680     59.590300   -1.376835   0.001925   1    0.004082
          1266839369.990     44.817815   -1.607564   0.012479   0    0.000000
          1266839370.120     44.606302   -1.605523  -0.007002   1    0.002738
          1266860253.490     44.615251    0.252483  -0.014001   0    0.000000
          1266860254.160     44.825963    0.252483   0.006281   1   -0.003860
          1266860268.360     59.597959    1.462901  -0.003784   0    0.000000
          1266860268.510     59.821265    1.462901  -0.002728   1   -0.003256
          1266860306.680     74.595496    0.336560   0.000096   0    0.000000
          1266860307.600     74.814029    0.241533   0.000954   1    0.000524
          OK

MS.OFF

Disables automatic correction of position errors when fiducials (e.g. magnesensors) are passed. If a fiducial is passed with such large error that MS.ON could not correct it even if it were enabled, the appropriate status bit is still set (see MS.ON for information about this status bit).

Any pending "MS.OFF time" commands are flushed. Note that the correction from the last fiducial passed is saved and will be applied as soon as MS.ON or CORRECT is issued.

Note: MS.OFF is the default state, and this is re-established at each INIT.

See also MS.OFF time and MS.ON.

MS.OFF time

Like MS.OFF, except disabling does not occur until the time specified. If the specified time has already passed, disabling occurs immediately.

MS.OFF or MS.ON flush a pending "MS.OFF time" command. If another "MS.OFF time" command is received while an old one is pending, the new one supersedes the old one.

Several commands flush queued MS.OFF time requests and (except as noted) immediately put the controller into an MS.OFF state. These include:

MS.ON

Enable position error corrections on the falling edge of a fiducial. The position error is the average between the position error measured on the leading and trailing fiducial edge.

There are two conditions when the controller does not make the correction. First, if the error is larger than a threshold, the correction is postponed until the next fiducial is seen. This helps to ignore noisy fiducial errors, but, it requires a slew past two or more fiducials to correct a large error. The second condition is if the correction can not be made before the current motion is complete. The controller knows how much time is left before motion stops, and it decides if the correction can be made before motion stops. If it can not make the correction, then a status bit is set. If a subsequent fiducial crossing can be corrected, the correction is made, and the status bit is cleared.

NOTE: If the error is too large to correct, the correction can manually be applied.

To manually correct a large error:

  1. axis stop or stop the move
  2. ms.dump - print fiducial errors and read the last error, call this E
  3. status - where is the axis now, call this X
  4. calculate the corrected position, call this Y = X+E
  5. set.position Y
  6. test slew across a fiducial and it should work

NOTE: The previous controller would set a status bit on an uncorrected fiducial crossing, and it ignored further corrections until a CORRECT command (manually apply the error) or a REMAP command is sent.

There really is no reason to remap an axis, because we always can guess roughly where the axis is, and then we can manually correct the offset error. There are two advantages to this, 1) it is quicker to find the axis, and 2) it does not require driving into a limit.

See also MS.OFF and MS.OFFtime.

Output percent

Set/get the motor output limit. No argument returns the limit. Value is integer percent, 0 to 100. The output is +-10 volts, so 55% is +-5.5 volts.

Use the DATAQ display to check the setpoint.

PARK

Alias: P

Drive the axis to the stow position.

RESET

Hardware resets the controller and halt any motion. Note: motion limits and the fiducial mapping are not lost. See also INIT

SET.LIMITS pos1 pos2 (*)

Sets the position limits. The limits may be specified in either order, i.e. the resulting lower limit = MIN (pos1, pos2), whereas the upper limit = MAX (pos1, pos2).

SET.POSITION pos (*)

Changes the internal measure of telescope position (incremental encoder position converted to degrees) to the specified value. This command can only be used when the motion is stopped. The update is bumpless because the encoder position is set at the same time as the error is zeroed. This command is used when the controller loses the current encoder position.

SET.TIME

For the SDSS MCP only: triggers the computer to set time based on NTP. All other controllers should ignore this command.

STATUS

Returns the state of the hardware and controller as follows:

position velocity time status_word index_position

where:

  • status_word word is a 32-bit integer described here. The word is returned in decimal; if you wish to see it in binary, use the hex() command in talk2boxes.
  • index_position is the position of the axis when the last encoder index mark was encountered

Sample output:

0.0000306    0.00000  1664.320     3147777    0.0000000 OK

See alsoMS.DUMP

STEP (*)

Set the step size to be used by + and - commands.

See also + and -.

STOP (*)

Alias: X

Immediately stop the current motion. This is useful if the motion needs to be abruptly stopped, for example there is a resonance or you are about to run into a limit. This is similar to pushing the E-Stop.

Z (*)

Set zero position. This is the same as set.position(0).

See also set.position.

Status Bits

Status bits indicate error (or warning) conditions. Some status bits are "sticky" in the sense that if the problem appears and then goes away, the relevant bits should remain set until the condition is cleared by an INIT. The limit bits, fiducial bits, and stop bit are not sticky.

Axis controller status bits are shown in the following tables (one for the 3.5m axis controllers, one for the SDSS 2.5m MCP).

3.5m Axis Controller Status

Bit  Hex 3.5m Meaning
0 00000001   Motor control buffer empty
1 00000002 Time ran out on an interpolated move (MOVE pos vel time)
2 00000004 At or past the min position
3 00000008 At or past the max position
4 00000010 not used
5 00000020 not used
6 00000040 Min limit switch has been encountered
7 00000080 Max limit switch has been encountered

8 00000100 Overspeed tripped
9 00000200 not used
10 00000400 not used
11 00000800 One or more stop buttons in
12 00001000 Disable switch
13 00002000 Motor output disabled
14 00004000 Motion error
15 00008000 Slip detected, motor encoder differs from Heidenhain by more than 12"

16 00010000 100 Hz clock signal missing
17 00020000 not used
18 00040000 Amplifier over temperature
19 00080000 Current limit on motor(s) exceeded
20 00100000 not used
21 00200000 not used
22 00400000 not used
23 00800000 not used

24 01000000 The last fiducial position error was too large
25 02000000 The fiducial was found behind its mapped position
26 04000000 The fiducial was found ahead of its mapped position  
27 08000000 The fiducial was passed with negative velocity

28 10000000 A correction for this fiducial was negative
29 20000000 Motor velocity exceeded
30 40000000 Controller restarted
31 80000000 Always zero

SDSS 2.5m MCP Status Bits

Bit Hex SDSS 2.5m Meaning
0 00000001   Motor control buffer empty
1 00000002 Time ran out on an interpolated move (MOVE pos vel time)
2 00000004 At or past the min position
3 00000008 At or past the max position
4 00000010 Velocity has been limited to the max set value
5 00000020 Acceleration has been limited to the max set value
6 00000040 Min limit switch has been encountered
7 00000080 Max limit switch has been encountered

8 00000100 In closed loop (opposite of bit 11)
9 00000200 Amplifier OK (opposite of bit 12)
10 00000400 No stop buttons are in (opposite of bit 13)
11 00000800 Out of closed loop
12 00001000 Amplifier is bad
13 00002000 One or more stop buttons is in
14 00004000 Semaphore taken
15 00008000 not used

16 00010000 1 Hz clock signal missing
17 00020000 clock_slow_signal
18 00040000 clock_not_set
19 00080000 not used
20 00100000 not used
21 00200000 not used
22 00400000 not used
23 00800000 not used

24 01000000 The last fiducial error was too large to correct
25 02000000 not used
26 04000000 not used
27 08000000 not used
28 10000000 not used
29 20000000 Windscreen bump going down or clockwise (sticky)
30 40000000 Windscreen bump going up or ccw (sticky)
31  80000000 Always zero

History

  • February 2, 2015: re-added SET.TIME as a standard command (since the MCP needs it), but now with no arguments. R.O.
  • April 11, 2014: added Communications section and rearranged a few topics; renamed to replace the vestigial Axis Controller main manual (which just pointed to this one).
  • March 6, 2010: added status bits for the 2.5m MCP. R.O.
  • February 22, 2010: New controllers.
  • August 3, 2001: Clarified how INIT should handle the status bits. R.O.
  • January 9, 2001: Removed incorrect time information added Jan 8. R.O.
  • January 8, 2001: Improved the description of the status word, added a link to documentation of the MCP's status word, and slightly modified the description of the STATUS command. Corrected the description of SET.TIME's parameters and improved the description of the command. R.O.
  • March 28, 2000: Added time to units. Marked "MOVE pos", "MOVE pos vel" and "+MOVE pos vel time" as not used by the TCC. Replaced magnesensor and magneswitch with "fiducial". Noted that the status bits are specific to the 3.5m telescope. Rearranged the table of contents so commands are last. R.O.
  • October 14, 1999: Removed GP1 and GP2 commands and all reference to guide position actuation (we've never implemented a guide positioner and the TCC no longer supports it). Moved all axis descriptors to one place (Axis). Added recommendations for handling axes specifications with multi-axis controllers to Axis, ID and INIT. Suggested a case where it may be best to be able to disable the command MS.ON (making it a null operation). R.O.
  • April 8, 1999: Documented conditions under which the MS.OFF time buffer should be flushed. Improved the description of MS.ON, MS.OFF and MS.OFF time. Added DRIFT to the list of commands that flushes the MOVE pos vel time command buffer. Changed the list of status bits to a table and added a "bit" column. Added the history section. Eliminated the use of <CODE>. R.O.
Fritz Stauffer and Russell Owen