}

gmech Actor

Overview

The gmech actor is an interface to the NA2 guide camera mechanical controller, which sets the filter number and focus position of the NA2 off-axis guider.

Gmech actor is based on TclActor. As such it has TclActor's standard commands and standard keywords. There are additional gmech-specific commands and keywords which are described in this manual.

Note: one may command piston or focus and these are related by by a constant offset: piston = focus + focusOffset. The idea is that each instrument at NA2 has its own focus offset, such that when gmech focus = 0 the instrument is in focus if the guide camera is in focus.

GMech Commands

In addition to the standard commands from TclActor, gmech supports the following commands (none of which are case-sensitive):

filter filter_number

Set the specified filter. Filters numbers are integers, starting at 0.

focus focus

Set the desired focus, in μm.

Piston = focus + focusOffset

focusOffset focusOffset

Set the desired focus offset, in μm, where:

Piston = focus + focusOffset

The piston is changed to preserve the current desired focus (unless the desired focus is unknown). Thus:

New focus = current focus
New piston = current piston + (new focusOffset - current focusOffset)

init

Stop all motion and initializes the controller. This is the only command that can interrupt the remap command.

Note: the init command does not connect disconnected devices; use the connDev for that purpose.

parameters

Display parameters such as filter names and motion limits for the actuators. Note: the information is only displayed to the user requesting it.

piston piston

Set the piston of the guider to the specified value in μm.

readFilterNames

Read filter names from the file $HOME/config/gmech.filters. The file format as follows:

  • One data line per filter, consisting of num name, where num an integer 0 through 6
  • Blank lines and lines starting with # are ignored
  • Excess whitespace is ignored (except within the filter name).
  • If a filter number is listed more than once then the last one is used.

If the filter names file cannot be found or contains unusable data then an error is reported and the old filter names are retained.

relPiston relPiston

Offset the piston, and thus the focus, of the guider by the specified value in μm.

New piston/focus = current piston/focus + relPiston.

Note that there is no separate "relFocus" command because this command does the job.

remap

Remap the actuators. This commands takes a long time to finish, but if necesary you can interrupt it using the init command.

status [doQuery]

Display the state of the piston and filter actuators. The output is described in the Keywords section. If doQuery is specified and is one of no, f, false, 0 or none then the hardware controller is not queried and the reported status is based on the last values read from the controller.

Note: if doQuery is false then the actuator status is only shown to the one user requesting it. This is because such status is considered somewhat less accurate than if it is freshly queried from the hardware controller.

FilterNamesGMech Keywords

Keyword data is output whenever the state of the gmech actor or underlying hardware and hardware controller changes. In addition to the standard keywords from TclActor, gmech supports a number of gmech-specific keywords described here.

Notes:

  • Actuator is a placeholder for Piston or Filter.
    • Piston position is in μm.
    • Filter "position" is the filter number (an integer starting from 0).
  • Numeric values (even integers) will be "NaN" if unknown
  • When you first connect you will be shown various status information including your own userID.
  • The actor polls the controller to detect change in state (such as the end of a move); thus there will be some delay in reporting change of state.

BadActuatorStatus

Indicates that ActuatorStatus is bad (one or more bad bits are set). The bad bits are 0-3: limit switches and software position limits.

Actuator=pos

Position of the of the actuator.

ActuatorError=delta-pos

Position error for the actuator (only reported if not moving).

ActuatorMoveTime=elapsed, total

Elapsed time (sec) and predicted total time (sec) for the current move. This keyword is only reported if the actuator is moving.

ActuatorStatus=0xhex

Actuator status word. The bits are as follows:

BitHexMeaning
00x01Limit switch 1 engaged
10x02Limit switch 2 engaged
20x04At maximum position (software limit)
30x08At minimum position (software limit)
40x10At requested position (move successful)
50x20Actuator powered down (move complete)

DesActuator=pos

Desired (commanded) position of actuator.

DesFocus=pos

Desired (commanded) focus.

FilterNames=name1, name2, ...

The name of each filter, in increasing numerical order. Each name is "" if the filter position is blank and "?" if the filter is unknown. The name may contain spaces or other special characters.

Focus=pos

Current focus.

FocusOffset=pos

Focus offset.

gmechConnState=state, reason

State of connection to the gmech hardware controller. State is one of Connecting, Authorizing, Connected, Disconnecting, Failing, Disconnected or Failed (the states of an RO.Comm.TCPConnection object). Reason is the reason it got to this state ("" if no reason given).

MaxActuator=pos

Maximum position of the of the actuator that may be commanded (inclusive).

MinActuator=pos

Minimum position of the of the actuator that may be commanded (inclusive).

Version History

1.0rc1 2008-07-09

  • Minor cleanups prompted by pychecker.

1.0b4 2008-02-11

  • Added the relPiston command.
  • Bug fix: piston and filter commands were never reported as finished.

1.0b3 2008-02-01

  • Made output of ActuatorError more reliable (it was only shown as a move ended).
  • Modified so INIT does not clear status (only REMAP and losing the connection do that).

1.0b2 2008-01-30

  • Added support for focus and focus offset.
  • Added parameters command.
  • Added basic support for filter names, including readFilterNames command.
  • Added doQuery argument to status command.

1.0b1 2008-01-25

The first beta release.