Functional Requirements

1.0 Scope

This document provides functional requirements for software needed for high level control of the NLCTA RF stations. NLCTA will have four high-power RF stations, one of which will be an injector station. Each RF station will have one VXI crate with CPU. There will also be one SLCNET micro with CAMAC crates to be shared by all the stations. There will also be a UNIX workstation with access to a hard disk.

Requirements are divided between two phases. Unless otherwise specified, all requirements are assumed to be Phase I:

o Phase I - required by July 1995

o Phase II - required by July 1996

BUYER BEWARE: This document contains all functions that will be provided by high level con trols. Although some extra functions outside the scope of this document may be provided for free, end users CANNOT assume that functionality not covered here will be available. For example, some functions will not be implemented using the SLC control system. People used to the SLC control system cannot assume that all functionality provided through this existing system will be available. The same is true for people used to EPICS - do not assume all functionality provided by EPICS will be provided for those functions implemented on the SLC control system.

The following major functions will NOT be provided for NLCTA RF:

1.1 There will be no YY-driven, pulseID-tagged VXI data acquisition. There will be no way to get RF data on a particular beam pulse for comparison purposes.

1.2 There are no requirements for fault accounting of VXI data or the ability to save VXI data after a fault to determine sequence-of-events.

1.3 There is no requirement that CAMAC data (ie, forward and reflected power, step ping motor positions and limit switches) be available to the VXI microprocessor.

1.4 If it is important for a particular error or condition to be logged and displayed in the control room, then it must be identified in this document. It is possible there will be no logging of errors not specified in this document. Also, it will not always be possi ble to associate an action by a particular user with an end result, not all user actions will be logged. Also, when SLC and NLCTA are both running, errors from both projects will go to the same error log and will be displayed in both control areas.

1.5 There is no requirement that the VXI microprocessors be booted from the SCP. The typical checks and network status and async information provided for the SLCNET micros will not be provided for the VXI microprocessors.

1.6 There are no security requirements. Anyone can do anything from any terminal. There will be no prompts to ask "who are you" and "why are you doing this". Also, anyone will be able to overload the system or network if they try hard enough.

1.7 The user interface for some RF functions will NOT have the same look-and-feel as the SLC control system. Use of an X-terminal and a mouse may be mandatory for some functions.

2.0 RF Monitor System (Phase I)

2.1 Waveforms

2.1.1 Video of I (in-phase) and Q (quadrature) will go into a VXI-based digitizing scope which will then be made available to users in the control room from an X-terminal. The waveforms will update on the X-terminal every 2 to 10 sec onds. The waveforms will have approximately 300 to 500 (a few waveforms will need 2000 points) covering a time span of 0.25 to 2 usecs.

2.1.2 Video of klystron beam current and voltage will also go into a digitizing scope and will be available at the same update rate. A gain and offset will be needed for converting (linearly) each point of each waveform to engineering units. These values will be enterable by the user and kept in the database.

2.1.3 The total number of channels needed for all I, Q, beam current, and beam voltage waveforms will be approx 17for the linac RF stations and 21 for the injector RF stations. The following waveforms will be available in the data base:

2.1.3.1 Vector Modulator Output Forward I and Q

2.1.3.2 Traveling Wave Tube (TWT) Output Forward I and Q

2.1.3.3 Klystron Output Forward I and Q

2.1.3.4 SLED Output Forward I and Q

2.1.3.5 Accel 1 Input Forward I and Q

2.1.3.6 Accel 2 Input Forward I and Q

2.1.3.7 Accel Output Forward I and Q

2.1.3.8 Klystron Beam Current (per klystron)

2.1.3.9 Modulator Voltage

2.1.3.10 (Injector Station Only) PB 1 Input Forward I and Q

2.1.3.11 (Injector Station Only) PB 2 Input Forward I and Q

2.1.4 Since the video waveforms will be multiplexed, different waveforms on the same digitizing scope will be acquired sequentially. Switching between channels can be done no faster than 30 hz. Note that the hardware will be set up so that switching between channels will be kept at a minimum for those channels used by fast calculations. Different RF stations will have a different number of digitizing scopes (ie, the injector RF station may have two and the linac RF stations may have one). Different scopes will have different multi plexing layouts and a different number of possible channels to switch between (ie, some scopes may only have two associated waveforms and oth ers may have seven).

2.1.5 Waveforms of amplitude and phase derived from each I and Q waveform pair will be available in the database at the same update rate as the I and Q pair. The following equations assume that I and Q will be orthogonal and will be equal amplitude at 45 degrees. Also, phase will be converted to 0 to 360 degrees depending on sign of I and Q. The scale factor and offsets will be provided by the user and kept in the database per wavefor(Figure)m.(Figure)

2.1.6 At a rate no less than once every 5 minutes and also on-demand (ie, from a correlation plot), the waveforms will be acquired and reduced to a few repre sentative numbers. For phase, the waveforms will be relatively straight lines. Otherwise, the waveforms will look like the following.(Figure)

2.1.7 The amplitude waveforms can be broken into two regions, region 1 which will ramp up and region 2 which will be relatively straight. The intersection (tmin) between the two regions will be approx 50 nsec for the injector and 100 nsec for the linac. The klystron beam current and voltage waveforms will be pulse-shaped and the only region of interest will be between tmin and tmax.

2.1.8 The following information per waveform I/Q pair or per non-I/Q waveform will be enterable by the user and kept in the database. Reasonable limits will be imposed on all entered values.

2.1.8.1 Total number of points for waveform displays

2.1.8.2 Total number of points for waveform fitting

2.1.8.3 Total number of points for sequential waveforms

2.1.8.4 Start and stop time (nsecs) for waveform displays

2.1.8.5 Start and stop time (nsecs) for waveform fitting

2.1.8.6 Start and stop time (nsecs) for sequential waveforms

2.1.8.7 Vertical sensitivity or gain (volts) for waveform displays

2.1.8.8 Vertical sensitivity or gain (volts) for waveform fitting

2.1.8.9 Vertical sensitivity or gain (volts) for sequential waveforms

2.1.8.10 Number of waveforms (for sequential waveforms only - 49 max)

2.1.8.11 Gain and offset per channel for conversion to EU

2.1.8.12 Intersections between regions (tmin and tmax)

2.1.8.13 Scale factor and offsets for phase and amplitude calculations

2.1.8.14 Alarm and warning limits for each fit result.

2.1.9 For phase, a linear fit will be done on the entire waveform. For amplitude, a linear fit will be done in both region 1 and 2. Tmin may be used as a first guess for a non-linear multi-step fitting procedure to find a more appropriate intersection point. For klystron beam current and voltage, a linear fit will be done on the points between tmin and tmax. The fit results will be kept in the database including:

2.1.9.1 Value and time of intersection point

2.1.9.2 Average of each applicable region

2.1.9.3 Slope of each applicable region

2.1.9.4 RMS residuals of the fit of each applicable region

2.1.9.5 Fit status of each applicable region

2.1.9.6 Warning and alarm statuses for all averages, slopes, and RMS's

2.1.9.7 Time stamp, roughly identifying the time the waveform was acquired.

2.1.10 The fit results will be available to the SLC control system for history-buffer ing, correlation plots, configurations, and alarming. Also, any fit with a bad status (either a bad fit or a fit outside of the alarm limits) will be logged in the error log when it first goes bad. As a minimum, the following fit results per station will be history-buffered:

2.1.10.1 Vector Modulator Output Forward Amplitude and Phase

2.1.10.2 Traveling Wave Tube (TWT) Output Forward Amplitude

2.1.10.3 Klystron Output Forward Amplitude

2.1.10.4 SLED Output Forward Amplitude and Phase

2.1.10.5 Accel 1 Input Forward Amplitude and Phase

2.1.10.6 Accel 2 Input Forward Amplitude and Phase

2.1.10.7 Accel Output Forward Amplitude

2.1.10.8 (Injector Station Only) PB 1 Input Forward Amplitude and Phase

2.1.10.9 (Injector Station Only) PB 2 Input Forward Amplitude and Phase

2.1.10.10 Klystron Beam Current and Voltage

2.1.10.11 Reference RF Amplitude and Phase

2.1.11 Waveforms on consecutive pulses will be required for phase modulation cal culations done on the VXI CPU and for saving to files (including ascii and MATLAB files) to be used by offline calculations on other CPUs. The desired number of consecutive waveforms (maximum of 49) will be speci fied by the user and kept in the database. Users will be able to save the con secutive waveforms on-demand to files which will then be available to all machines that support the file transfer protocol (FTP). It is anticipated that users will only do this about 1 to 10 times a day. The scratch files will be deleted on some periodic basis probably no more than once a week. Phase and amplitude calculations and fitting of consecutive waveforms will NOT be required. There is also NO requirement to record the time between the consecutive waveforms or the rate that the waveforms were acquired.

2.1.12 A user interface will be provided to reset any digitizing scope and associated multiplexers. The reset will reinitialize the digitizing scope and multiplexers and configure non-waveform-specific setup parameters. A message will be logged whenever a reset is attempted. All digitizing scopes and multiplexers will be reset when the VXI microprocessor is rebooted.

2.1.13 A user interface will be provided to show diagnostic and informational data from the multiplexers and digitizing scopes. This data will only be refreshed on-demand by the user. When the refresh is requested, all the registers will be read and any errors will be accessed and then cleared.

2.2 Monitoring of CAMAC Data

2.2.1 The following power and phase measurements will be available to the SLC control system via standard CAMAC modules. Some will be acquired using GADCs and others will be acquired using SAMs. Some will be peak-and- hold and the others will be sample-and-hold.

2.2.1.1 Vector Modulator Output Forward Power

2.2.1.2 TWT Output Forward Power

2.2.1.3 Klystron Output Forward Power

2.2.1.4 Klystron Output Reflected Power

2.2.1.5 SLED Output Forward Power

2.2.1.6 SLED Output Reflected Power

2.2.1.7 Phase Shift across SLED

2.2.1.8 Accel 1 Input Forward Power

2.2.1.9 Accel 1 Input Reflected Power

2.2.1.10 Accel 1 Output Forward Power

2.2.1.11 Accel 1 Output Reflected Power

2.2.1.12 Accel 2 Input Forward Power

2.2.1.13 Accel 2 Input Reflected Power

2.2.1.14 Accel 2 Output Forward Power

2.2.1.15 Accel 2 Output Reflected Power

2.2.1.16 (Injector Station Only) PB 1 Input Forward Power

2.2.1.17 (Injector Station Only) PB 1 Input Reflected Power

2.2.1.18 (Injector Station Only) PB 2 Input Forward Power

2.2.1.19 (Injector Station Only) PB 2 Input Reflected Power

2.2.2 A conversion from voltage to power, nominal beam energy, and energy- noload (ENLD - the energy load of a single electron on an optimum phase) will be required. There is no requirement that Enominal and Enoload be kept in the database or be available for history-buffering, correlation plots, config urations, or alarming. However, a special display will be required to show these three values per GADC channel. Three scaling factors will be required per power and will be kept in the database: scale1 = coupler ratio scale, scale2 =geometrical, and scale3 = fudge factor.(Figure)(Figure)(Figure)

2.2.3 The status of the limit switches of the stepping motors and the stepping motor positions will be available to the users via CAMAC, just like any other SLC-style digital and analog status.

2.2.4 The interface to Cassels`s PLC and modulator will be using CAMAC and existing software. See Bob Fuller for more information.

2.2.5 Control of all non-VXI devices will be using CAMAC and existing software. See Bob Fuller for more information.

2.3 Fault Monitoring, Alarming, Error Logging, and RF Station Control

2.3.1 Errors and messages identified in this document from ALL systems will be logged in the SLC error log. Action will be taken to prevent floods of error messages.

2.3.2 Alarms identified in this document from ALL systems will be available to the VAX Summary and Information Process (SIP) for display and logging purposes. The existing user interface for alarm acknowledgement and associ ation of a cater with an alarm will be provided. When alarms from the VXI system cannot be accessed (ie, the system has crashed), an error will be logged.

2.3.3 High power RF fault information will be available to the SLC control system (via CAMAC LDIMs). The fault indication will show what happened (ie, high reflected power or arcing) and where it happened. When the high power RF system faults, the user will have to do a manual reset (no requirement for a software interface).

2.3.4 Each VXI module will have its own set of warning and failure conditions which will be read periodically and reported as errors and alarms to the users. Also, if there is a problem setting up a multiplexer or digitizing scope to get a waveform, an error will be logged. The list of bits for each module is still being developed. Most modules will have temperature warnings. The refer ence RF module will have a phase-lock error. The VXI crate will have the following types of modules:

2.3.4.1 I/Q Modulator

2.3.4.2 I/Q Demodulator

2.3.4.3 Arbitrary Function Generator

2.3.4.4 Cosine DAC

2.3.4.5 Digitizing Scope

2.3.4.6 Switch (MUX)

2.3.4.7 Reference RF

2.3.5 A user interface will be provided to show diagnostic and informational data from all modules. This data will only be refreshed on-demand by the user. When the refresh is requested, all the registers will be read and any errors will be accessed and then cleared.

2.3.6 A user interface will be provided to reboot the VXI microprocessor after a crash or crate power-up occurs or whenever a new database, sequence, or code needs to be loaded. All user-enterable parameters and control variables will be restored across a reboot.,

2.3.7 The timing system will be used to take the RF station off the beam and put it into the standby mode. The existing user interface for the timing system (ie, mulitknobbing) will be used. There are no new software requirements.

3.0 SLED Delay Line Tuning

3.1 The SLED IIs will be tuned using 2 stepping motors (left and right) and 2 power detectors (forward and reflected power). The tuning will be done using common and differential motion. One power will be maximized and the other minimized.(Figure)

3.2 Specific PHASE I requirements include:

3.2.1 Tuning will be done on demand using the existing correlation plot and multi knob actuator facilities from the VAX SCP as follows:

3.2.1.1 The actuators are set to some initial value (ie, the middle). The actuator settling times are entered. The option to trim or perturb the actuators is chosen.

3.2.1.2 The actuators are moved as specified (ie, in equal steps and oppo site direction or equal steps and same direction). The move time will be limited by hardware (probably < 5 min).

3.2.1.3 After the movement is finished, the power data is retrieved.

3.2.1.4 Steps (2) and (3) are repeated to get a full set of data. Note that the user will be informed of any error during the correlation.

3.2.1.5 The user may accept the extreme value (maximum or minimum). Note that this will require some sort of sample-and-hold hardware and some sort of trigger hardware (ie, SAM or GADC). The gate must be 0.1 usec +/- 0.05 and the amplitude resolution must be 0.1% (> 10 bits).

3.2.2 Users will have the ability to knob the actuators using the existing VAX SCP multiknob facility. Also, the existing magnet facilities will be available to trim or perturb the stepping motors.

3.2.3 The stepping motor positions will be saved and restored by the users using the existing VAX SCP configuration facilities.

3.2.4 Because of temperature changes, some sort of automatic tuning done by the VAX will be required, where the time between adjustments is 10 to 30 min utes. The time interval may be shorter if the effect on the beam is minimal (does not affect experiments being run). The actuators will be moved over a much smaller range (ie, +- 0.002" from their current positions). This is to keep the gradient stable to 0.1% and the position stable to 0.0006".

3.3 Specific PHASE II requirements include:

3.3.1 The stepper motors will need to be automatically trimmed every 5 minutes to keep the phase difference at zero requiring two new slow feedback loops on the VAX. One loop will control phase0 and the other will control the maxi mum phase. More detailed requirements will be provided later.

4.0 Klystron Phase Modulation

4.1 DC Phase Shift - Phase II

4.1.1 A slow feedback loop will be provided to calculate a new phase from the klystron output fitted phase value and the setpoint using either deadband con trol or a PID loop. This loop will run no faster than once a minute. The loop will calculate the sine and cosine of the new phase and update these values in the 2-channel Cosine DAC (COSDAC) module. The COSDAC module will linearly convert the settings to I and Q voltages using gains and offsets set in the hardware (these values are not provided by software). The COSDAC will update the I and Q values in the vector modulator.

4.1.2 The user will be able to choose the feedback running mode (ie, off or on). A message will be logged whenever the running mode is changed.

4.1.3 A user interface will be provided to enter the desired klystron operating phase setpoint. The user will be able to save and load the setpoint using the SCP configuration facility. The user will also be able to select a gain and other feedback parameters (more detail later). The user will be able to select the rate that klystron output fitting is done - this will dictate the rate that the feedback loop runs at. There is no requirement to synchronize this update rate with any trigger. A message will be logged whenever anything is changed.

4.1.4 From the SCP, the user will be able to knob or enter the klystron operating phase with an immediate update of the COSDAC. The user will also be able to step the phase from the SCP correlation plot facility. There is no require ment that the SCP software automatically turn the feedback loop off while the phase is being adjusted and back on after the adjustment is finished - the user must remember to do this.

4.1.5 A user interface will be provided to reset the COSDAC module. A message will be logged whenever a reset is attempted. When the VXI microprocessor is rebooted, the COSDAC module will be reset.

4.2 Repititive Phase Error Correction - Phase I

4.2.1 For Phase I, a table of I and Q waveforms (setpoint table) will be updated in the arbitrary function generator (AFG) from a file at user request. A message will be logged whenever an update is done. Double-buffering will be imple mented so that the AFG can operate while a new table is being loaded. No periodic update is required.

4.2.2 The user will be able to enter the full name of the file to load. This name will be kept in the database for reference. The generation of the files containing the I and Q waveforms will be done by other groups. File management and configuration control will also be done by other groups. The files will be kept on a disk that can be accessed by the VXI microprocessor.

4.2.3 For debugging purposes, a readback of the current setpoint table in the AFG will be available on user request.

4.2.4 The user will be able to disable and enable the AFG. A message will be logged in either case.

4.2.5 It would be nice but is not a requirement that the user be able to save and load the setpoint table using the SCP configuration facility.

4.2.6 A user interface will be provided to reset the AFG. A message will be logged whenever a reset is attempted.

4.2.7 When the VXI microprocessor is rebooted, the last loaded setpoint table is automatically reloaded.

4.3 Repititive Phase Error Correction - Phase II

4.3.1 In addition to the requirements of Phase I, an adaptive feedforward calcula tion will be done and a calculated table of I and Q waveforms will be updated in the AFG at a maximum rate of 180 hz. This calculation will require refer ence I and Q waveforms, the default setpoint table, a table of gain values, and 49 sequential I and Q waveforms of klystron or SLED output. These 49 sequential waveforms will only be updated on-demand from the user (proba bly 1 to 10 times a day). The equation used in the calculation will be the same as that used by LANL (see C. Ziomek paper as a starting point).

4.3.2 The user will be able to choose the feedback running mode (ie, off, open- loop, or on). When in open-loop, the loop will just update default setpoint table in the AFG as described in Phase I. A message will be logged whenever the running mode is changed.

4.3.3 In addition to the default setpoint table, the user will be able to change the feedback loop update rate and specify a table of gain values and other feed back parameters (more detail later). A message will be logged whenever any thing is changed.

5.0 Optics

5.1 In phase I, no optics software changes are required since all the NLCTA magnets come after all the RF stations. The energy at the first marker point of the first NLCTA modelling section must be determined and entered manually by the user from the SCP.

5.2 In phase II, the RF stations and magnets will be interspersed. It may be possible to use the existing software without change by adding phantom SLC-style klystrons to the SLC database to be referenced by modelling skeleton decks, and allowing user entry of ENLD from a special NLCTA-specific panel.

5.3 Note that NLCTA modelling and steering will involve creation of and update to def inition files by Mark Woodley. A new Twiss parameter mode may also be defined by Mark only if it can be done without the need for a new NLCTA-specific machine mode since SLC and NLCTA must share the same machine mode so they can run at the same time. Mark will also specifiy and provide whatever new software is required to convert BDES to KMOD for NLCTA magnets.

6.0 Timing System

NLCTA will have the following triggers, requiring allocated PDU output channels.

Table 1: RF-Related Triggers (per RF Station)

---------------------------------------------------------------
| Device                                              | Type  |
===============================================================
| Klystron Modulator Main (10 to 180 hz)              | TRBR  |
---------------------------------------------------------------
| RF Pulse - rectangular window of RF (10 to 180 hz)  | TRBR  |
---------------------------------------------------------------
| TWT (same as modulator main)                        | TRBR  |
---------------------------------------------------------------
| Arbitrary Function Generator                        | TRBR  |
---------------------------------------------------------------
| VXI Digitizing Scope - Trigger 1                    | TRBR  |
---------------------------------------------------------------
| VXI Digitizing Scope - Trigger 2                    | PP    |
---------------------------------------------------------------
| Power & Delta Phase GADCs                           | YY    |
---------------------------------------------------------------
| Power & Phase Sample-and-Hold's                     | TRBR  |
---------------------------------------------------------------
| Miscellaneous Scope - Trigger 1                     | TRBR  |
---------------------------------------------------------------
| Miscellaneous Scope - Trigger 2                     | PP    |
---------------------------------------------------------------

Table 2: Other NLCTA Triggers (Separate Crate)

----------------------------------------------------
| Device                                   | Type  |
====================================================
| BPMs                                     | YY    |
----------------------------------------------------
| Toroids in VXI                           | YY    |
----------------------------------------------------
| Miscellaneous Gun-Related Triggers       | PP    |
----------------------------------------------------
| Miscellaneous Data Acquisition Triggers  | PP    |
----------------------------------------------------

TRBR = Trigger Base Rate (derived from 119 Mhz, must be >= 10 hz, usually 10, 30, 60, 120, 180)

PP = Pulsed Pattern - Trigger based on Beam Code Modifier Bits and Timing Variables

YY = Trigger scheduled by the MPG, used for on-demand data acquisition

6.1 The master pattern generator (MPG) will limit the NLCTA beam rate to a lower value when a machine protection system (MPS) or beam containment system (BCS) fault occurs. This rate-limiting will affect NLCTA only and will not affect SLC. Also, the MPG software will be changed so that SLC rate-limiting will not affect NLCTA.

6.2 NLCTA will probably have its own beam code scheduling group (BGRP) and its own beam codes. New regional beam code modifier bits and timing variables may be required. The existing SLC rate-limiting modes (zero, 1 hz, 10 hz) will be adequate for setting up the NLCTA BGRP.

6.3 The beam code(s) for NLCTA will be broadcast no faster than 10 hz. NLCTA (10 hz), SLC (120 hz), and CRYO (60 hz) should not have to share timeslots (total = 360). This is required to prevent rate-limiting for one project from affecting another project.

6.4 The user will be able to change the NLCTA beam rate from the SCP similar to the way it is done for SLC.