UIST CCS
UIST Cryostat Control Software
| Authors: |
Alastair Borrowman (ajb) |
| Revision: |
1.3 |
| Revision History |
|
|
| 1.0 |
26feb2002 |
Initial Version (ajb) |
| 1.1 |
05mar2002 |
Add sections Overview of UIST CCS and
Instructions for Loading and Running the CCS (ajb) |
| 1.2 |
20mar2002 |
Minor modifications and update (ajb) |
| 1.3 |
19jun2002 |
Add section Calibration of Datum Switch Position (ajb) |
Contents:
Links to other pages:
UIST CCS in CVS
The UIST Cryostat Control Software (CCS) is contained in the CVS module
uistCCS.
To obtain a copy of the software use the following command:
> cvs checkout uistCCS
This produces the following directory structure:
Software documentation can be found by following the above links to the README
files.
The README in the toplevel directory also contains build instructions.
Please note that the READMEs are designed to be read in conjuction with
comments contained within the files they document.
Back to Top
Overview of UIST CCS
The UIST instrument has 10 motor driven mechanisms, 8 inside the cryostat and
2 in the Calibration Unit. The Cryostat Control Software controls all mechanism
movement. Each mechanism must be able to:
- datum
- accept request to move to target position
- report when a move is complete
- report errors
The mechanisms can be split into two types:
- circular, non limited travel
- linear, limited travel
The UIST mechanisms are:
| Inside Cryostat (order following optical path) |
|
| Image Rotator |
linear |
| Filter Wheel 1 |
circular |
| Filter Wheel 2 |
circular |
| Slit Wheel |
circular |
| Grism Wheel 1 |
circular |
| Grism Wheel 2 |
circular |
| Camera |
circular |
| Focus |
linear |
| Calibration Unit |
|
| Mirror |
linear |
| Attenuation Plate |
linear |
Circular and linear mechanisms have to conform to the same requirements and
use the same motors and datum switches. This enables the CCS to use generic
software to control all mechanisms, eg. the same code is used to control the
Slit Wheel and the Focus mechanism.
The UIST CCS uses a similar combination of Gemini CAD (Command Action
Directive), CAR (Command Action Response) records and SNL (State Notation
Language) to control mechanism movement as used by Michelle. Each
mechanism has 1 CAD and CAR record. However, Michelle uses a different
SNAM (subroutine name executed when the CAD record is processed) for each of
its mechanisms, UIST has 1 SNAM to control mechanism motor movement. It is
called motorCadSnam() and the source code is in src/mechanism.c. Michelle also
uses different SNL programs to control each of its mechanisms, UIST uses 1,
called mechanism_st, the source code is in src/mechanism_st.st.
The movement of individual mechanisms is customised using EPICS database
records. The values of the records are used by the SNL to decide how the
mechanism should be moved. The record values are loaded at startup from PV
load .data files (each mechanism has its own file). The file sets values in
various records including; motor record (eg. limits, velocity, backlash,
etc.), records that store information about datum switch position and values
used during datuming (eg. datum switch to be used for datuming, datuming
velocity, initial number of steps to use in incremental search for switch,
etc.). The PV load .data files are in the data/directory.
Each mechanism also has a cruLib .data file containing information about
target name position and their corresponding step position. These are also
loaded at startup and are in the the data/ directory.
For more detailed information on the CCS please see the individual READMEs
contained in the uistCCS CVS module and linked to in
UIST CCS in CVS of this document.
Back to Top
Instructions for Loading and Running the CCS
Loading CCS
The CCS runs on a Motorola mv167 processor located in a VME crate, or in
EPICS terminology an IOC (Input/Output Controller), using the vxWorks
operating system.
When the crate is powered on or rebooted the processor automatically runs
the uistCCS startup script (see statup/README) to load and start the
software. To view the startup process use the CCS serial console
button on the uistMenu interface, see section Running CCS below
for information on how to start the interface.
Once the startup script has finished the crate can be accessed across the
Ethernet using telnet or rlogin, eg:
The uistCCS script sets the vxWorks prompt to be
uistCCS-> .
To restart the system, use the vxWorks command
reboot and the system will be reloaded.
Running CCS
- ensure you source the uist/etc/cshrc script and issue the command
baja to setup the correct
environment for running UIST software.
- Note for users doing development work, ie. editing files and
recompiling CCS or Edict software, non-development users can ignore
this step. At the ATC the vxWorks images used by the CCS and Edict
are in different directory trees, for this reason an additional command
has to be used to setup the correct vxWorks environment. Logging in as
user uist by default sets the environment required for Edict
development work, if your work involves development for the CCS use the
command 68k on the xterm where
the work will be carried out. Use the command
baja to return to an Edict
development environment.
- use the following command to start a menu with buttons giving access
to DM screens, processor serial ports, etc.:
Back to Top
Calibration of Datum Switch Position
To ensure a mechanism can be postioned accurately, irrespective of datum
switch used to define the datum position, the number of steps between
datum switches must be known. This section details how to measure this
distance and update the information in the pvload .data files.
Circular Mechanism
A circular mechanism always defines datum switch 1 to be at step 0, what
needs to be found is the number of steps from step 0 to datum switch 2.
This can be done using a mechanism's Engineering DM screen to move
between datum switches and querrying the CCS Log file to find the
number of steps moved.
Procedure:
- Start UIST CCS Engineering DM screen:
> dm uistCCS_eng.dl &
- Start individual mechanism DM screen using the related display button
of the mechanism, eg. Filter
Wheel 1
- Start your favourite editor and open the current CCS Log file,
the current file in use can be found by using the following command
at the CCS processor prompt:
uistCCS-> elgReport
the following command can be used to put a reference mark in the file:
uistCCS-> elg "\n\n\n filt1: Start of
Filter Wheel 1 datum switch calibration\n\n"
- Force the mechanism to datum using switch 1 and remain at datum position:
- On the individual mechanism DM screen switch the Datum Force
button to true
- Push 1 on the Select
Switch button
- In Target name text entry box enter 0 (this will ensure the mechanism remains at the
datum switch after datuming has completed)
- Press the START button to begin
the datuming process
- Now datum on switch 2 by doing the following:
- Switch Datum Force button to
true
- Push 2 on the Select
Switch button
- In Target name text entry box enter the current step number used as
the position of datum switch 2, this can be found in the mechanism's
pvLoad .data file by searching for the string "datum2PosLo", alternatively
at the CCS processor command line prompt use the following commands:
uistCCS-> dbgrep "*datum2PosLo"
will return a list of records containing datum switch 2 position for
each of UIST's mechanisms
uistCCS-> dbpr "uist:ccs:filt1:
datum2PosLo" changing the record name in quotes of this command
to the mechanism being calibrated will display the current step number
of datum switch 2 in the VAL field
- Press the START button to begin
the datuming process
- On the top level UIST CCS Engineering DM screen press the
Log Flush button
- Refresh the editor looking at the CCS Log file, eg. in emacs revert
the buffer, so that all data written during the datuming prosess is
contained in the file
- Record the RBV value of the step at which datum switch 2
was found. This will be towards the end of the log file on a line
that has the following format:
Datumed, switch found with 1 step
movement, RBV = 24481.0
- Repeat steps 4 to 8 another nine times in order to calculate an average
RBV value at which datum switch 2 is found. This is the step position of
datum switch 2 relative to datum switch 1. The repeating of these
steps can be done using an engineering exec loaded and run using
the tcl/tk engineering interface.
- Update the mechanism's pvLoad .data file, instructions for doing
this are in data/README (link to this file is in section UIST CCS in CVS). The value to change is
the figure loaded into the
datum2PosLo record, eg:
long uist:ccs:filt1:datum2PosLo
= 24480;
Note that records used by both Filter Wheels and both Grism
Wheels are in the same file, ensure that the record changed
belongs to the correct wheel, eg. the above record belongs to
Filter Wheel 1 and will only affect the behaviour of this wheel
Linear Mechanism
Calibrating the step position of linear mechanism datum switches follows
the same procedure for setting of datum switch 2 as used by cicular
mechanisms, however, the step postion of datum switch 1 can not be arbitarily
set to 0, the distance from end of travel (hard stop) to datum switch
1 has to be discovered.
A linear mechanism's movement and relation to end stops and datum
switches is shown in the the diagram below.
| HSLE | | | | D1 | | D2 | | | | HSHE |
| | | <------------------ Range of Travel ------------------> | | |
| | | | /\ | | /\ | | | |
| | | <- D1 closed -> | : | <- D1 & D2 open -> | : | <- D2 closed -> | | |
| Step 0 |
| HSLE | Hard Stop Low End of travel |
| HSHE | Hard Stop High End of travel |
| D1 | Datum Switch 1 |
| D2 | Datum Switch 2 |
The low end of travel is defined as step 0, what needs to be found is the step
number at which D1 transitions from closed to open with a single
step movement when moving in a positive direction, ie. towards the hard stop
at the high end of travel. This step will be defined as the step position of
datum switch 1.
The only way to position the mechanism at the end stops is under visual
control, therefore the following procedure is carried out while the instrument
is warm and the mechanism datum switches and hard stops can be seen.
Note Uist's motors are specially prepared for working at cryogenic temperature,
for this reason the motor movement should be kept to a minimum while the
instrument is open, alternatively a motor which has not been cryogenically
prepared should be used to replace the normal operating motor.
The mechanism must be moved under direct control instead of using the
normal control software, the normal control software datums the mechanism
before moving to a requested position, datuming cannot be done until
the position of the datum switches have been determined.
The mechanism can be moved under direct control using the individual mechanism
DM screen, the procedure for this is:
- Start individual mechanism DM screen using the related display button
of the mechanism, eg. Image Rotator
- Switch on the power to the motor by pushing the Power button
to On
- In the bottom half of the DM screen are the Motor Record fields,
towards the bottom of this are fields used to Drive the motor,
to move the motor to step S enter in the text field labelled
VAL* the value S, when
return is pressed the motor will start moving to step S, once
there the RBV field will
show step S as the current read back value, ie. the current
step
Using the above procedure move the mechanism towards the lower hard stop,
as the motor is moving negative steps from current position
it will actually move to a step that
is S minus the back lash (current back lash setting is displayed in the
BDST field of the Motor Record
section of DM screen), ie. if requested to move to S=100 and with BDST=80,
the mechanism will move to step 20 and then forward 80 steps to remove the
back lash and achieve S=100.
Once positioned as close to the hard stop as possible recalibrate the
mechanism so the current position is step 0:
- Under the Calibration heading of the Motor Record
section of the mechanism's DM screen is the field SET,
enter 1 and press return,
the field will now display the value
SET, altering the VAL field will no longer cause the
motor to move
- Define the current step as 0 by entering
O in the VAL* and DVAL* fields
- Take the motor record out of calibaration mode by entering the value
0 in the SET field,
Use will now be displayed
and any changes to the VAL* field will cause the motor to
move
Now the search for datum switch 1 can begin:
- Under direct control move the mechanism forward 50 steps
- Continue moving forward 50 steps until the text update field of
datum1 displays open
- Move back 50 steps and ensure datum1 now displays
closed, if this is not the case
continue moving back 10 steps at a time until the switch does close
- Move forward with 10 step increaments until the switch again goes
open
- Move back 20 steps and ensure the switch is closed, if it is not closed
move back at 5 step intervals until it is closed
- Move forward with 1 step increaments until datum1 displays
open. The transition of
the datum switch from closed to open with 1 step movement has now
been found, record the step value displayed in the
RBV field
- Move back to the step close to the hard stop where the search for
the datum switch began (step 0) and repeat steps 1 to 6 another nine times
- The step postion of datum switch 1 is the average of the 10 step
positions at which the switch was found.
Note if at anytime the end stop is hit during the above
procedure then the process should be started again, hitting the hard
stop will cause a loss of steps to occur and so the step at which datum
1 is found will no longer be relative to the step positions at which it
was previously found.
Note in the above process the term moving forward implies
moving positive steps from current position, ie. towards hard stop at high
end of travel, and moving back implies moving negative steps from
current position, ie. towards hard stop at low end of travel.
In the mechanism's pvLoad .data file update the value used as step position
of datum switch 1, the record containing the value is called
datum1PosLo, the line in the data
file will be similar to:
long uist:ccs:imRot:datum1PosLo = 227;
Follow instructions in data/README file (see link to this file in section
UIST CCS in CVS) for implementing the
change.
Once the position of datum switch 1 has been determined the position of
datum switch 2 can be found following the same instructions as used
to find datum switch 2 of a circular mechanism, see above. While the
insturment is warm only a rough estimate of datum 2 position will be
posible, the procedure should be repated once the insturment is at
operating temperature.
The measuring of steps between lower hard stop and datum switch 1 can
not be done to great accuracy due to not being able to carry out the
calibration procedure at operating temperature, however what is
necessary is that during normal working operations, ie. moving to
requested position and datuming, the mechanism does not hit the hard
stops, carrying out the above procedure does enable this to be done.
For operating accuracy it is then important to define the number of
steps between datum switches at operating temperature, which can be
done following the instructions above detailing calibration of
datum switch 2 for Circurlar Mechanisms.
Back to Top
|