A consequence of this architecture is that while a fiducial crossing is being processed on one axis, fiducial crossings on the other axes are ignored. This is unfortunate but necessary --- the MEI is unable to latch the different axes separately, so the MCP is unable to read the position of the second fiducial. It would be possible to generate a warning, but doing so would significantly complicate the code.
MS.
; this stands for
MagnetoSensor, and reflects this history of the APO 3.5m.
The full command set is as follows; only MS.ON
and MS.OFF
are generated by the TCC; for
a discussion see documentation of
Axis Controller commands
MS.WRITE
.
MS.READ
.
MS.ON
.
MS.OFF
.
MS.ON
is allowed to apply
CORRECT
is equivalent to a MS.ON
/MS.OFF
pair of commands, with the exception that an arbitrarily large correction
is allowed.
MS.WRITE
.
MS.READ
.
MS.ON
, that is, stop updating the encoders
every time that a fiducial is crossed. If the time delay dt
is specified, only disable updates after dt
seconds.
MS.ON
command is received for a given axis,
and until a MS.OFF
is seen (or takes effect if a delay is
specified), the encoders for that axis are corrected each time that
a fiducial is crossed.
More precisely, the MCP maintains a table of the `true' position
of each fiducial, and notes the difference between this position
and the encoder reading each time a fiducial is crossed; when
requested MS.ON
is active, the encoder is adjusted
to make this error zero. It would
be possible to use the history of errors for a given axis to
estimate the error, but at present this is not done.
A SET_FIDUCIAL_ERROR
entry is written the the
mcpFiducials-mjd.dat
file every time that the encoders
are updated.
Because the MEI supports no atomic `update this axis' command, the
correction is applied in software; all positions that are sent to
or received from the MEI are corrected by the appropriate amount. Only
when the axis is given an INIT
command is the encoder
actually updated.
MS.ON
can make to
max
. If a larger correction is requested an error message
is written to murmur (unless max
is zero), and the
correction is not applied. Furthermore, no further corrections are
permitted for that axis until after an INIT
, and the
ms_on_correction_too_large
bit is set in the axis status
word.
You should use the CORRECT
command to apply arbitrarily
large corrections to an axis.
file
,
as if they had just been crossed.
Note that this doesn't make them the `correct' values; to do that
you must use the MS.DEFINE
.
Any lines starting #
are comments and are ignored, with
the exception of a line that looks like
# type fiducials
; type
may be
azimuth
, altitude
, or rotator
.
If this line is seen, the axis type must agree with the
current axis.
Data lines are of the form
7 0 +- -9999.000000 0 0 +- -9999.000000 0 8 100167224 +- 0.000000 1 100167224 +- 0.000000 1where the first integer is the fiducial index; the next the value for encoder1 for that fiducial, followed by its error; then the number of points that were averaged together to derive the value; then the corresponding values for the second encoder. Only the fiducial number and the two positions are used, except that the special error value
-9999
is used to label a missing value.
When you switch to a new version of the MCP (using switchMCP
)
the fiducial tables in the new version are installed in
/p/mcpbase
; they are downloaded to the MCP itself at boot time.
file
. Only useful if you're not
sure what's currently loaded into the MCP.
The format is:
# # rotator fiducials # # Creator: rhl # Time: Fri Nov 02 09:36:47 MST 2001 # Input file: /mcptpm/52159/mcpFiducials-52159.dat # Scales: 0.021315785186278132 0.021315786787577316 # Canonical fiducial: 78 # Arguments: -mjd 52159 -rot -time0 999838149 -time1 999841558 -canon -reset -scale -table rot.dat # # Fiducial Encoder1 +- error npoint Encoder2 +- error npoint ... 4 59366318 +- 4.6 6 59366599 +- 1.2 6 5 58565519 +- 4.7 6 58565809 +- 0.9 6 ...An error of
-9999
is used to indicate that a value is missing.
The iop command readMcpFiducials
is used to produce fiducial
tables, e.g.
readMcpFiducials -mjd 52193 -alt -canon -reset -scale -table alt.dat \ -time0 1002767494 -time1 1002768300 readMcpFiducials -mjd 52193 -az -canon -reset -scale -table az.dat \ -time0 1002759866 -time1 1002763821 readMcpFiducials -mjd 52159 -rot -canon -reset -scale -table rot.dat \ -time0 999838149 -time1 999841558
A SET_FIDUCIAL_ERROR
entry is written the the
mcpFiducials-mjd.dat
file every time that the encoders
are updated.
/mcptpm/mjd/mcpFiducials-mjd.dat
where
mjd
is the current SDSS-modified Modified Julian Day.
The typedef
s in the file are:
MS.DEFINE
command has been
issued; which axis was affected is logged.
plotMcpFiducials -mjd 51799 \\ -alt -y pos1 -x time -reset -canon -scale -table stdoutThe file (by default the current one) is read, and the readings of the specified encoder for the specified axis are analysed.
A complete list of options is available via plotMcpFiducials -help
If you specify -x
and -y
a plot of
x
v. y
is generated; useful choices for
x
are fididx
(fiducial index), time
,
or index
; you will usually want to use pos1
or pos2
for y
. Unless you specify
-absolute
, the value for each encoder will have a mean
value subtracted; exactly how that mean is determined is described in
the next paragraph.
If you specify -x time
all the times will have a suitable
offset subtracted from them (it's given in the axis label). If you
choose -x index
the x-axis will be the rank
of the measurement's timestamps (i.e. the array index), starting at 0.
There are a number of flags to control how the mean value for each
fiducial is determined:
Azimuth | 33 | 31016188 |
Altitude | 1 | 3825222 |
Rotator | 83 | 40168185 |
-fiducialtable
to specify which fiducial table
should be used (e.g. -error -fiducialtable /p/mcp/mcpVersion/%s.dat
,
where %s
will be replaced by e.g. "rot";
-fiducialtable mcpVersion
is also permitted) If you don't specify
a table the one current when the data was taken will be used.
The value that -scale prints out is exactly the value that should be in the file mcp/mcp-new/axis.h.
For axes that don't wrap (i.e. altitude) the relative scale is still correct;
the numbers in the fiducial table are -(range in encoder counts) seen on
the two encoders.
Implies the -absolute
flag.
-time0
for the meaning of small values of t1.
Optionally, a fiducial table in the correct format for MS.READ can be
generated (using the -table
flag).