RD Controls Software Release Note 157.8
AutoTune

John DeVoy

February 4, 1999

AutoTune is an X Window applicationgif that displays a set of SWIC profiles relevant to a particular beam line, and allows the operator to adjust the beam position by directly manipulating the profiles on the screen. When the profiles have been adjusted to the operator's satisfaction, pressing the ``Do Tune'' button will cause AutoTune to determine which magnet settings need to be changed, and then to make the settings. The SWIC profiles are updated every T6 + 8 seconds, so the effects of the changed settings should be shortly visible.

The program is divided into two parts: A server part and a client part. The server part is a detached process that runs on some node in the DISNEY VAX cluster. The server is responsible for doing all data acquisition and settings. It communicates with the client part via the network. There is one server process dedicated to each beamlinegif.

The client part provides the (Motif based) user interface. When it is started, the client connects to the desired server (see section 1, below). The server monitors the beam position, and sends the data to the client for display. The user may use the client to move the beam (as described above); the request is fowarded to the server, which makes the settings, and reports the results back to the client for display. Note that the server is written in such a way that any tune request from an account other than OPS will be rejected.

Starting

To run AutoTune, select ``AutoTune Proton'', ``AutoTune Neutrino'', or ``AutoTune KTev''from the second page of the general user menu. Similar items are available on the OPS menu. An AutoTune client will be started that will connect to the indicated server. If the user running the client is the OPS account, then the user may use the client to control the beam. Otherwise the user may only monitor the beam's position.

Alternatively, the AutoTune client may be started in such a way as to bypass the server. In this mode, the client does not connect to a server, but does all of the necessary data acquisition and settings by itself. This is called standalone mode. Standalone mode is intended for beamline physicists to use when testing new control files. The ability to do tunes in this mode is dependent on one's PIG privileges.

To start the client in standalone mode, type ``@epicure_programs:autotune'' with the following parameters:

For example, the following command will load the ``PROTON_TEST'' control file from Gaston's MTUNE directory on RDIV:
@epicure_programs:autotune   proton_test.ctl   rfd$disk1:[gutierrez.mtune]

Quitting

To exit AutoTune, select ``Exit'' from the ``File'' pull-down menu.

Selecting a Server

When the AutoTune client starts, it automatically connects to the appropriate server (depending on which item you selected from the menu). You may change servers at any time by selecting a new server from the ``Server'' option menu on the main screen.

As a special case, the option labelled ``Stand Alone" can be selected to put the client into standalone mode (see section 1).

Loading Control Files

To load a new control file, select ``Open'' from the ``File'' pull-down menu. A file selection dialog box will pop up containing a list of control files from which to choose. By default, the program searches the following directories for control files:

DISNEY::USR$DISK1:[OPS.NMTUNE]

DISNEY::USR$DISK1:[OPS.NTUNE]

DISNEY::USR$DISK1:[OPS.PTUNE]

DISNEY::USR$DISK1:[OPS.MTUNE]

This will cause the server to load the specified control file. This feature is disabled if the user running the AutoTune client is not OPS.

In standalone mode, any user may load a control file.

Main Screen

The main screen displays an array of SWIC profiles. One horizontal and one vertical profile is displayed per SWIC. The set of SWICs that are displayed is determined by the control file that is currently loaded by the server. A vertical slider to the right of each pair of profiles allows one to select a particular scan to view. The calculated position of the scan being displayed is shown in a label above each profile. The position is calculated relative to the marker, or to the center if there is no marker.gif Underneath each profile is a horizontal slider, with which one may move the profile by up to 10 wires in either direction. The profile will automatically track the slider as it is moved. If a slider is disabled (grayed out), then the corresponding profile is not controllable.

If there are more profiles than will fit on the screen, then one may either make the window larger, or use the scroll bars provided to scroll the display.

If a profile has a large ``X'' drawn over it, or if the marker lines are missing, then either the scanner, or the FIFO device has returned an error status. Section 10 explains how to get more information.

If the calculated position is not shown (that is, if a straight line is drawn through the field that would normally contain the position,) then the beam intensity is too low to permit an accurate calculation. See section 11.

Closeup View

To see an expanded view of a profile, select ``Closeup'' from the ``Options'' pull-down menu. Then, from the sub-menu, select the name of the desired SWIC. A dialog box will pop up that shows a larger view of the selected SWIC's horizontal and vertical profiles.

The closeup view also prints each profile's position relative to the marker (or center), and the marker positions.

Do Tune

After using the sliders to adjust the position of each profile, press the ``Do Tune'' button to cause the settings on the appropriate magnets to be adjusted and move the beam. A dialog box will pop up that displays progress messages as the program performs each step in calculating and changing the settings. These messages are also written to a log file (see section 12 for more details about the log file).

This dialog box can be popped up at any time by selecting ``Server Progress'' from the ``Options'' pull-down menu. The dialog box will save the results from previous tunings; a scroll bar is provided so that all of the previous messages can be seen.

Note that the server will reject a request to move the beam that comes from any account other than OPS. The ``Do Tune'' is disabled for non-OPS users.

In standalone mode, any user may press the ``Do Tune'' button. But if the user does not have the necessary PIG privileges, then one or more settings will fail, and an error message will be displayed.

Aborting

The progress dialog box contains an ``Abort'' button. Pressing this button after a tune has started, but before any settings have been made ( at time T3), will cause the tune to be aborted (that is, no settings will be made).

If the ``Abort'' button is pressed after the settings have begun, or after they have finished, then there will be no effect.

Modes

An option menu in the upper-left corner of the screen shows the mode of the server. (The modes are described in the following subsections). This option menu is disabled for non-OPS users, unless the client is in standalone mode.

Manual Mode

In ``Manual'' mode, the operator must explicitely request all changes (by setting the sliders, and then pressing the ``Do Tune'' button).

Semi-Automatic Mode

In ``Semi-Automatic'' mode, the program will monitor the beam position, and if/when the beam strays off of a marker (or center, if there is no marker), the program will pop up a dialog box that asks for permission to make the changes.

When the dialog box is popped up, the terminal will beep, and if the program is iconifed, it will de-iconify itself.

Each section of a beamline area has a SEM associated with it in the control file. If the reading from the SEM is below a threshold value, also set in the control file, then the program will not attempt to tune that section.

The following buttons are displayed at the bottom of the dialog box:

Dismiss:
Pressing ``Dismiss'' will cause the dialog box to be unposted, with no other effect. If the position of the beam is not corrected, then the dialog box will be popped up again after the next spill.

Accept:
Pressing ``Accept'' will cause the proposed changes to be made. This is the same as if the operator had made the changes manually, and then pressed the ``Do Tune'' button.

Display:
Pressing ``Display'' will cause the sliders on the main screen to be adjusted to reflect the proposed changes. The operator may then press either ``Accept'' or ``Do Tune'' to effect the changes.

Note: After pressing the display button, the operator may modify the changes by adjusting the sliders on the main screen. In this case, the ``Do Tune'' button will include the changes in the tune, but the ``Accept'' button will send the proposed changes without the modifications.

If the operator does nothing, then the program will wait, but will keep the dialog box updated to reflect the current beam conditions. If the beam corrects itself (or if the operator adjusts the magnets via another mechanismgif), then the dialog box will be unposted.

Automatic Mode

In ``Automatic'' mode, the server will monitor the beam position, and if/when the beam strays off of a marker the server will make the settings necessary to correct the beam. A dialog box will pop-up showing the progress messages from the tune (see section 7, ``Do Tune''). Note that the server will continue to automatically tune the beam even if there is no operator watching the server. The following constraints are placed on the server when it is in automatic mode:

SWIC Status

If an erorr occurs while reading a SWIC scanner, then a large ``X'' is drawn over the profiles. If an error occurs while reading a FIFO device (the FIFO devices are what the program uses to read the marker positions), then the marker lines will not be drawn for that SWIC.

To find out more information, select ``SWIC Status'' from the ``Options'' pull-down menu. A dialog box will pop up containing the most recent status message from each device.

Note: If a SWIC scanner is set up to collect fewer than ten scans, then the empty scans will be marked with an ``X'' if you try to view them. If the status dialog box shows a success status for a profile that has an ``X'' drawn over it, then that scan is not being collected by the scanner. For example, if a SWIC is in fast spill mode, and is only collecting six scans, then scans seven through ten will be marked with an ``X''. The SWIC will also be marked with an ``X'' if it is out of the beam.

SEMs

The control file associates a SEM and a threshold value with each beam area. If the reading from a SEM is below the threshold value, then the program will not try to tune that area when in Semi-Automatic mode. This is to prevent false alarms when the beam is off or at low intensity. The user may still tune those areas manually. Also in this case, the calculated positions displayed on the main screen will be replaced with a straight horizontal line.

To see the current reading and thresholds for the SEMs, select ``SEM status'' from the ``Options'' pull-down menu.

Logicals

AutoTune needs to have certain logicals defined in the job logical table (for the client), or the system logical table (for the server). These logicals are automatically defined by the startup file in the Epicure programs area (see section 1). This list is included for completeness, and will probably not be useful to the general user.

AUTOTUNE$FILES:
The directory in which AutoTune will look for control (and other) files. This logical must be defined.
AUTOTUNE$DEFAULT:
The particular server to connect to, or control file to load, when the program starts. If the translation matches the name of a server, the the program connects to that server. Else it is interpreted as a control file name. If the directory is omitted, then the directory pointed to by AUTOTUNE$FILES will be used. If the file extension is omitted, then the extension ``.CTL'' will be used. If this logical is not defined, then the first file found with the extension ``.CTL'' will be used.
AUTOTUNE$LOGDIR:
The directory in which AutoTune will put its log files. A log file is created every time a tune is done. The contents of the log file are the same as the server progress dialog box. The name of the log file has the form: TUNE_<control>.<date>, Where <control> is the name of the control file being used, and <date> contains the date and time that the tune was started. This logical must be defined.
AUTOTUNE$TEMPDIR:
The directory in which AutoTune will put any necessary temporary files. This logical must be defined.
AUTOTUNE$TRANSPORT:
The name of the transport executable file. The full name, including the directory and disk, must be specified.
AUTOTUNE$NETNAME:
The DECnet task name to use for the server. This logical must be defined on each node that is running a server.
AUTOTUNE$SERVER_NODES:
A list of nodes on which servers might be running. When attempting to connect to a server, the AutoTune client program will try each node until it succeeds.
AUTOTUNE$SERVERS:
A list of servers. This list is used to build the ``Server'' option menu in the AutoTune Client program. When the user makes a selection, the program will look for the selected server on each of the nodes specified by the logical ``AUTOTUNE$SERVER_NODES''.
AUTOTUNE$SERVER_PARAMETERS:
The full path name of a file that the server uses to store information that it needs at startup. Currently, the file contains the name of the control file, and the mode. These are saved in the file whenever they are changed. They will automatically be retrieved if the server restarts. Thus the operators do not need to modify the startup file to change the control file or mode. This logical must be defined on each node that is running a server.
AUTOTUNE$SERVER_MODE:
Defined by the server in user mode as part of its startup. Not visible from outside the program.

Possible Problems

Network error sending/receiving message

A dialog box will pop up with this message if the AutoTune client loses the connection to the server. The name of the server and the node that it was running on will be included in the error message. The probable reason for the error is that the server has crashed, or been restarted. The EOPERATOR account can be used to see if the server has crashed (``check autotune''), and if necessary restart the server (``restart autotune''). Use the ``Server'' option menu on the main screen of the program to reconnect to the server once it is restarted.

Unable to connect to autotune server

A dialog box containing this message will pop up if the AutoTune client is unable to connect to the selected server. This can happen on startup or when the user selects a new server via the ``Server'' option menu. If a server that is supposed to be running is not, it can be restarted via the EOPERATOR account (see above).

Semi-Automatic mode does not work

If the server is in Semi-Automatic mode, the beam is out of position, and the program is not reacting, it may be because the designated SEM has too low a reading. The control file associates a SEM and a threshold value for each SWIC in the control file. If the reading from the SEM is below the threshold, the the program will not propose a tune based on that SWIC. This is to prevent the program from trying to move the beam when the intensity is too low for an accurate measurement of the position.

``X'' is drawn over a scan

If a SWIC profile has a large ``X'' drawn over it, then that SWIC is returning an error status. Select ``SWIC Status'' from the ``Options'' pull-down menu to pop up a dialog box that contains the most recent status message from each SWIC. If the status for the SWIC is good, but the ``X'' is still drawn, it may be that the SWIC is set up to collect fewer than ten scans. Try adjusting the ``Scan'' slider on the main screen.

The SWIC shows no markers

If a SWIC profile shows no markers, but the cable TV display does show markers, then there is a problem reading the FIFO (A FIFO device is associated with each SWIC scanner, and is used to read out the markers, as well as other infomation). Select ``SWIC Status'' from the ``Options'' pull-down menu to pop up a dialog box that contains the most recent status message from each FIFO.

The server is tuning, but I never pressed ``Do Tune''

If the AutoTune client pops up a dialog box announcing that a tune is in progress, and you never pressed the ``Do Tune'' button, then it means that either: somebody else (from the OPS account) has started the tune; or the server is in automatic mode, and has decided on its own to move the beam. When the server is not in automatic mode, then only the OPS account can tell a server to start a tune, but the progress messages are sent to all clients that are connected.

The ``Do Tune'', ``Mode'', and ``Open'' buttons are disabled

The ``Do Tune'' button, ``Mode'' option menu, and the ``Open'' button in the ``File'' menu are disabled when the AutoTune client connects to a server and the user is not OPS.

Non-OPS users can move the beam by using the ``Server'' option menu to put the client into standalone mode, and then loading the appropriate control file. Note that such users will still need PIG privilege to make the required settings.

The sliders on the main screen are disabled

While a tune is in progress, until T6 + 8 secs after the tune is done, the program will disable the horizontal sliders under the profiles that are used to adjust the beam. This is done because the displayed profiles are not current while the tune is in progress.

The calcuclated position of the beam is not shown

If the calculated position of the beam on the main screen is missing (that is, if it is replaced by a straight horizontal line), then the beam intensity is too low to permit an accurate calculation. See section 10. The calculated position is also not shown if the SWIC is out of the beam.

The button for automatic mode is disabled

The automatic button is disabled if the client is in standalone mode. It is also disabled for non-OPS users when connected to a server (in fact, all of the mode buttons are disabled in this case). Only the OPS account is allowed to change the server mode.

The server is in automatic mode, but is proposing a tune as though it were in semi-automatic mode

If the beam is at any point more than four wires away from the desired position, then it will ask for permission to move the beam, as though it were in semi-automatic mode. This is to prevent the program from automatically making radical changes.

Keywords: RDCS, Transport, Tuning, Reading, Setting, Beamline, X
Distribution: normal

...application
As an X Window application, the output of this program can be displayed only on an X terminal, or on a workstation that is running an X-based windowing system (such as DECwindows.)
...beamline
Presently, there are PROTON, NEUTRINO, and KTEV servers. A MESON server can also be added.
...marker.
Note: This program uses a different algorithm than the one that calculates the mean for the TV monitors.
...mechanism
Such as page.
...wires
This value can be changed, if necessary
 

devoy@fnal.gov

Security, Privacy, Legal