Go to bottom of page
4.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . 4-1
4.1.1 THE PROGRAMMABLE DELAY UNIT (PDU) . . . . . . . 4-2
4.1.2 The T_MATRIX And Timing Data Structures . . . . 4-4
4.1.3 Pulse Class Devices (PCD'S) . . . . . . . . . . 4-5
22.214.171.124 PSU . . . . . . . . . . . . . . . . . . . . . 4-6
126.96.36.199 PAU . . . . . . . . . . . . . . . . . . . . . 4-6
4.1.4 DUPCD'S . . . . . . . . . . . . . . . . . . . . 4-6
4.1.5 Software Control Of Timing Devices . . . . . . 4-7
188.8.131.52 SCP . . . . . . . . . . . . . . . . . . . . . 4-7
184.108.40.206 Micro . . . . . . . . . . . . . . . . . . . . 4-7
220.127.116.11 BDL . . . . . . . . . . . . . . . . . . . . . 4-8
4.2 GENERATION OF THE T_MATRIX (TGEN) . . . . . . . . 4-9
4.3 TIMING-RELATED PANELS . . . . . . . . . . . . . 4-10
4.3.1 Master Timing Panel . . . . . . . . . . . . . 4-11
4.3.2 Individual-sector Trigger Panels . . . . . . . 4-11
4.3.3 DUPCD Displays Panel . . . . . . . . . . . . . 4-13
4.3.4 Klystron Control Panels . . . . . . . . . . . 4-14
4.3.5 Diagnostics Panel . . . . . . . . . . . . . . 4-15
4.4 MAJOR SUBROUTINES IN THE SCP . . . . . . . . . . 4-15
4.4.1 T_MATRIX_ADJUST . . . . . . . . . . . . . . . 4-15
4.4.2 TIME_BTN_HANDLER . . . . . . . . . . . . . . 4-16
4.4.3 T_MATRIX_KNOB . . . . . . . . . . . . . . . . 4-16
4.4.4 KTRG_PNL . . . . . . . . . . . . . . . . . . . 4-17
4.4.5 DEVICE_ACTIVE_DISP . . . . . . . . . . . . . . 4-17
4.4.6 TIMING_DISP . . . . . . . . . . . . . . . . . 4-17
4.4.7 DEVICE_TIME_DISP . . . . . . . . . . . . . . . 4-17
4.4.8 TIME_DIAGNOSTICS_PANL . . . . . . . . . . . . 4-18
4.4.9 PDUXPGM, PDU_GETDELAY, PDU_GETPP, PDU_READ_PDU,
4.4.10 BEAM_DISPLAY . . . . . . . . . . . . . . . . . 4-18
4.4.11 BCOD_PNL And BCOD_DISP . . . . . . . . . . . . 4-18
4.5 BASE RATE TRIGGERS (TRBR'S) . . . . . . . . . . 4-18
4.6 THE VERNIER DELAY UNIT (VDU) . . . . . . . . . . 4-20
4.7 TRIGGER GATE AND SYNCHRONIZER (TGAS) . . . . . . 4-22
4.7.1 Details Of Algorithm . . . . . . . . . . . . . 4-22
4.8 TIME JOB IN THE MICRO . . . . . . . . . . . . . 4-24
4.8.1 Downloading Of T_MATRIX Data . . . . . . . . . 4-25
4.8.2 Initialization Of PDU's . . . . . . . . . . . 4-26
18.104.22.168 Initialization Of The PAU . . . . . . . . . 4-29
22.214.171.124 Initialization Of The PSU . . . . . . . . . 4-29
4.8.3 Updating PDU's, PAU's, And PSU's . . . . . . . 4-30
126.96.36.199 Updating The PDU . . . . . . . . . . . . . . 4-30
188.8.131.52 Updating The PAU . . . . . . . . . . . . . . 4-31
184.108.40.206 Updating For The PSU . . . . . . . . . . . . 4-31
4.8.4 Pattern Interrupt Handler . . . . . . . . . . 4-31 CHAPTER 4 TIMING SYSTEM
4.1 INTRODUCTION The SLC timing system allows precision (~1-2 nsec) control of the trigger times of klystrons, beam position monitors, and other devices on a pulse-to-pulse basis at up to 360 Hz. Facilities exist to set up and adjust the timing of devices or groups of devices independently for beam pulses having different destinations and purposes, which are run in an interlaced fashion during normal machine operation. The interlaced operation of beams with different paths, repetition rates, energies, and functions is based on a 16-bit code called PPYY. This code is used by the timing software and hardware to select the times at which devices should be triggered on an upcoming machine pulse. The high order eight bits, called PP or the "beam code", are used to select the time delays for klystrons, kicker magnets and other devices which are needed to produce a specific type of beam. The low order eight bits, called YY, are used to synchronize additional devices; for example, when a user wishes to gate and readout beam position monitors.
TIMING SYSTEM Page 4-2 The reference signal for timing, a 476 MHz cw signal with a phase-locked 2.1 nsec "fiducial pulse" superimposed at a rate of 360 Hz, appears on the main drive line. Communication of PPYY occurs on a dedicated subchannel of the CATV communications cable, the same cable which is used for communication between control programs residing in the VAX and the local micros. The same timing software runs in each of the sector microprocessors, with the particular configuration of triggered devices being specified in the appropriate section of the SLC database. In addition to the sector micros, there is a special micro, the Master Pattern Generator, which is responsible for broadcasting the PPYY code for each machine pulse. The PPYY code is broadcast on the cable through a Cable Access Transmitter (CAT)module and received by a Cable Access Receiver (CAR) module in each of the sector micros. Receipt of PPYY by the Cable Access Receiver module causes the Pattern Receiver Interrupt Module to produce a Multibus interrupt that invokes an interrupt handler in the micro's timing job.
4.1.1 THE PROGRAMMABLE DELAY UNIT (PDU) A central feature of the timing system is the Programmable Delay Unit (PDU) CAMAC module. The PDU has 16 channels, each of which can produce a trigger at a different time with respect to the fiducial. The PDU is clocked by a signal from the fiducial detector, which produces a 119 MHz pulse train (476 Mhz Main Drive Line signal divided by 4) with a missing pulse at fiducial time. Thus the PDU counts
TIMING SYSTEM Page 4-3 "ticks" of approximately 8.4 nsec (1/119MHz) starting from the fiducial. The output pulses from the sixteen channels of the PDU are distributed on the upper backplane of the CAMAC crate. These signals may also be brought out through the front panel of the Simple Timing Buffer (STB) CAMAC module. Each PDU channel can be programmed in one of four different modes. The timing system software uses information in the database to determine in which mode a channel is to be used. Internal to the PDU is an array, the pattern timing table, which can contain up to 256 19-bit delay values for each of the 16 channels. How (and whether) all these values are used for a given channel depends on which of the four programming modes is used for that channel: o PP mode: the delay time with respect to the fiducial depends on the beam code PP. Delay values for different PP's are stored and updated in an array in the VAX (see next section); the appropriate parts of this array are sent to the microprocessor, which loads them into the pattern timing table of the PDU via CAMAC. o YY mode: The delay time with respect to the fiducial depends on the value of YY. A particular YY value can be made to produce specified delay(s) from specified channel(s) by programming the appropriate locations in the PDU pattern timing table. o Base-rate mode: Only the first 36 locations in the part of the pattern timing table for a given channel are used, as a modulo-36 counter. The pattern of delays in these channels
TIMING SYSTEM Page 4-4 is repeated ten times each second. o Reuse mode: The same delay is produced on every pulse, regardless of the value of the PPYY code.
4.1.2 The T_MATRIX And Timing Data Structures The most important data structure used by the timing control software in the VAX is the T-MATRIX, which is in shared memory, accessible to the SLC Control Programs (SCPs) and to other programs running in the VAX. The rows of the T-MATRIX correspond to the beam codes and the columns to triggered devices. In other words, a row of the T-MATRIX contains the time delay with respect to the fiducial, in units of PDU ticks, for each of the devices in the system that are to be triggered according to the value of the PP part of the PPYY code. The time delay with respect to the fiducial of the pulse produced for a triggered device by its associated PDU channel is the sum of several components: TDELAY = TREF+PDUT+TNOMINAL+OFFSET Two of these components are independent of the beam code and are kept in the database. The first component, TREF, is associated with the PDU, while the second component, PDUT, is associated with the triggered device. TREF is the time delay needed to produce a PDU pulse that is simultaneous with the passage of a reference beam, as seen on an oscilloscope. The PDU pulse is brought to the oscilloscope through an
TIMING SYSTEM Page 4-5 STB, and the signal from the passage of the beam comes through a CAMAC module. The reference beam is produced 1025 microsecond after the fiducial, as measured by a standardized procedure at the injector. Thus TREF is essentially the time of passage of the beam with respect to the fiducial, when all propagation delays are taken into account. PDUT is a "standard" delay with respect to the passage of the beam for the triggered device with which it is associated. TNOMINAL is a term associated with a specific beam code, that takes account of the fact that the beam may be shifted with respect to the reference beam time. TNOMINAL can in fact be different for different sectors of the machine on the same beam code. Any additional corrections needed for the triggered device on a particular beam are represented by the OFFSET term. The T_MATRIX is automatically set up by a program called TGEN, using information in the database. TGEN searches the database for devices that are to be triggered according to the PP beam code, allocates space for each of them in the T-MATRIX, and sets up arrays of pointers into the T-MATRIX. TGEN is run immediately after a new database is generated or after changes have been made in the database that will affect the structure (as opposed to just the values) in the T-MATRIX. After TGEN has been run, saved sets of delay values for triggered devices can be restored to the appropriate locations in the T-MATRIX.
4.1.3 Pulse Class Devices (PCD'S) The PDU is the most important Pulse Class Device (PCD) in the timing system, but there are also two others. These are the Programmable
TIMING SYSTEM Page 4-6 Synchronization Unit (PSU) and the Pulsed Amplitude Unit (PAU). Each of these devices produces outputs depending on the value of the beam code PP, and so their values for all the different beam codes are kept in the T_MATRIX, just as for PDU channels.
220.127.116.11 PSU - The PSU produces a train of pulses starting at a specified delay after the fiducial. The value of this delay (in ticks) is what is kept in the T_MATRIX, while the number of pulses, the pulse spacing, and the pulse width are determined by database parameters (and at present can only be changed by doing a DBEDIT).
18.104.22.168 PAU - The PAU produces a voltage level, depending on the value of the beam code. Thus the value kept in the T_MATRIX for each beam code is not a time delay at all, but rather an index (between 0 and 32 inclusive) into an array of possible voltage levels.
4.1.4 DUPCD'S Each PDU channel that is being used in "programmed" mode (mode 1, 3, or 5) is associated with a device, which will often be referred to as a DUPCD (Device Using Pulse Class Device) in what follows. The most important examples of such devices are KLYS, SBST, and TRIG.
TIMING SYSTEM Page 4-7 Unlike the PDU, the PSU and the PAU are essentially single-channel devices, so they are each regarded as being their own DUPCD, where it is useful to preserve this analogy in the software.
4.1.5 Software Control Of Timing Devices
22.214.171.124 SCP - The SCP allows users to control the delay times that are output by PP-mode PDU channels in a straightforward manner. Users may activate and deactivate triggers from touch panel buttons and may adjust a delay or set of delays from a knob. Such functions are also supported for the PAUs and PSUs, and to some extent, certain other special devices (VDU, TGAS). The YY-mode channels delay times are put into the PDU's pattern timing table on request from the BPM or other software, in advance of the receipt of the desired YY(s). The reuse channel delay times can only be changed by editing the database and then rebooting the micro; these times are not intended to be changed casually. Programming of the base-rate mode PDU channels is also supported in the SCP.
126.96.36.199 Micro -
TIMING SYSTEM Page 4-8 Timing system software support in an individual sector microprocessor is provided by one of a set of jobs running in the multitasking environment provided by the Intel iRMX operating system. The timing job consists of a background task, a pattern interrupt task, and a pattern error interrupt task. Since the machine is run in a pipelined mode, the pattern interrupt task must read the 16-bit code PPYY for the "next plus two" beam from the pattern register on the PRIM board and then broadcast the three pipelined PPYY codes to the CAMAC crates. The most important functions of the timing job's background task are to initialize the PDUs and to update timing delay values in PDU memory upon request from SCPs or other programs running in the VAX. It also initializes and updates the other two Pulse Class Devices (the PAU and PSU modules), and handle some special devices, the Vernier Delay Unit (VDU) and Trigger Gate and Synchronizer (TGAS), each of which produces a delay with resolution smaller than a PDU tick by controlling the value of a timing increment to be added to the output of its associated PDU channel.
188.8.131.52 BDL - There exists a (now nearly obsolete) interactive standalone program called Beam Design Language (BDL) that can be used to change T_MATRIX values. Nearly all of its functionality has been moved to the SCP, but it is still minimally supported and is sometimes useful for testing and debugging of timing related software. See the BDL chapter in BUG for details.
TIMING SYSTEM Page 4-9
4.2 GENERATION OF THE T_MATRIX (TGEN) The program TGEN (actually, a set of subroutines in DBGEN, as well as being available as a standalone image) sets up the T_MATRIX using information in the database. TGEN also fills in several secondaries in the database: o Under the primary :PDU : -- - :CHMO: - Channel modes o Under each DUPCD primary -- - :TPNT: - T_MATRIX column allotted to the DUPCD (exactly one) TGEN allocates space in the T_MATRIX for each DUPCD it finds in the database. Each primary representing a device using a PDU channel and programmed on PP must have the following secondaries: :PDUC: xx,4,3I2; !PDU Channel Assignment (channel mode, !PDU unit number, and channel number) :PDUT: xx,4,1I4; !Standard activate time (ticks w.r.t TREF) :TPNT: xx,4,1I2: !T_MATRIX column (filled in by TGEN) Devices programmed in the modulo-36 channel mode have their own primary (probably :TRBR:) and include the following secondaries:
TIMING SYSTEM Page 4-10 :PDUC: ! - as above ( channel mode is redundant informaton) :TMSK: xx,2,2Z4; ! 36-bit trigger mask :PDUT: xx,2,1I4; ! Time with respect to TREF (ticks) Note that the secondaries TMSK and PDUT are supertype 2 since they are used by the micro at PDU initialization time. No information about the modulo-36 channels is kept in the T_MATRIX. Devices programmed on YY ( :BPMP:, :TORO:, :GADC:, :CALP:) are also searched for in the database by TGEN, even though no information about these devices is kept in the T_MATRIX. This is so that the channel mode (CHMO) secondary can be filled :CHMO: xx,2,16I2; Channel modes in correctly. All PDU channels not assigned to one of the above modes are taken to be reuse channels and are programmed accordingly by the micro when the PDU is initialized. Their times with respect to TREF are kept in the secondary :REUT: xx,2,16I4 under the PDU primary.
4.3 TIMING-RELATED PANELS There are several main classes of timing panels, described below.
TIMING SYSTEM Page 4-11
4.3.1 Master Timing Panel This is the top level panel, from which most other timing panels and various displays are accessed. It includes: o Individual-sector trigger panel select buttons o Timing displays panel select button o MPG code and MPG rate displays o Other panel select buttons
4.3.2 Individual-sector Trigger Panels These are analogous to the magnet and klystron sector panels in that there are a set of switches to choose the devices (in this case DUPCDs) to be controlled and a set of buttons to perform operations on these devices. These panels contain: o DUPCD select switches - Individual DUPCDs - excluding klystrons, whose timing would be handled from the set of klystron control panels (see below). These switches are labelled with DUPCD primary and unit, and alias name, if any. - All DUPCD units of a given primary, e.g. ALL TRIG, so that these groups of DUPCDs can be activated, deactivated, set to given TDES, etc. with a single button press. At present, the only important DUPCD primary associated with PDU's belonging on this panel is TRIG. However, the other DUPCDs namely PSU and PAU can be controlled from these panels.
TIMING SYSTEM Page 4-12 o Beam select button Pushing this button prompts for desired beam and writes it on the button, unless the beam number is hardcoded on the button, in which case no prompt is given. o Timing function buttons These include: - Assign knob to selected DUPCD(s) and beam A knob may be assigned to a single DUPCD or to all DUPCDs of a particular PRIM type (e.g. TRIG). The knob will be labelled with the alias name (up to 6 characters), the beam number, and the time with respect to TREF in nanoseconds, in the case of a knob assigned to a single unit. For example: ALIAS 12 -345.0 If there is no ALIAS in the database , then the first two letters of the primary name, and the unit number are used to label the knob, e.g. TR 204 5 84.03 for TRIG, 204 on beam 5. - Activate selected DUPCD(s) on selected beam This sets the pulse time to the "standard" activate value derived from the database quantities TREF and PDUT and the NOMINAL time for the sector.
TIMING SYSTEM Page 4-13 - Deactivate selected DUPCD(s) on selected beam - Reactivate selected DUPCD(s) on selected beam - Enter TDES for selected DUPCD(s) and beam: To be used in cases where it is inconvenient to knob from the standard activate value. Prompts for desired time with respect to TREF+NOMINAL (in nanoseconds). - Deactivate selected DUPCD(s) on all beams - Timing displays buttons - Diagnostics panel select button These timing unit select, timing functions, and timing knob assign buttons also appear on a number of special purpose panels in the SCP.
4.3.3 DUPCD Displays Panel Two displays having to do with DUPCDs are accessed from this panel: 1. DUPCD-active display: Shows the activity of selected DUPCDs on all beams. 2. Display giving timing data for selected DUPCDs on a single beam: Includes alias name, PDUT, time with respect to TREF+NOMINAL, and NOMINAL time for the sector, plus identification by database primary, micro, and unit. The DUPCDs are selected from a menu of buttons labelled with the database primary names of DUPCDs (TRIG,KICK,KLYS, etc) or ALL*. The micro(s) will be selected from one of three buttons:
TIMING SYSTEM Page 4-14 1. ALL* micros 2. Individual micro select buttons
4.3.4 Klystron Control Panels There is one such panel per sector, containing: - Device select buttons: - Individual KLYS and SBST units - ALL KLYS - ALL SBST - ALL UNITS (klystron and subbooster) 1. Function select buttons: - Activate selected DUPCD(s) on selected beam This sets the pulse time to the "standard" activate value derived from the database quantities TREF and PDUT and the NOMINAL time for the sector. - Deactivate selected DUPCD(s) on selected beam - Reactivate selected DUPCD(s) on selected beam - Enter TDES for selected DUPCD(s) and beam: To be used in cases where it is inconvenient to knob from the standard activate value. Prompts for desired time with respect to TREF+NOMINAL (in nanoseconds). - Deactivate selected DUPCD(s) on all beams - Timing displays buttons These panels are similar to the sector trigger timing panels. The function of the Activate button is basically to set the timing to the normal activate value derived from the database TREF for the PDU, the PDUT for the selected KLYS or SBST, and the current value of T_NOMINAL for the selected micro and beam, just as for TRIGs. However, if a KLYS is being activated, the SBST is also automatically activated if
TIMING SYSTEM Page 4-15 it is not already active. If the SBST is already active, but at an offset from the normal activate value, then the same offset is added to the normal KLYS value. Also whenever a KLYS or SBST is to be activated, its TMSK is checked for compatibility with the selected BEAM TMSK. The deactivate and assign-knob functions work the same as on the trigger timing panels.
4.3.5 Diagnostics Panel This is accessible from individual-sector timing panels. It contains additional diagnostics and displays, including: o Single unit database display for selected DUPCD o Single unit database display for selected PDU. o Display of channel allocation in selected PDU. o Button to reinitialize the selected PDU. This reinitializes the PDU just as if the micro were being rebooted, downloading the current data from the the T_MATRIX and database. o Buttons to select any other PDU in the micro
4.4 MAJOR SUBROUTINES IN THE SCP
4.4.1 T_MATRIX_ADJUST This is the main routine to make changes in the T_MATRIX via the sector timing panels. It handles the activate, deactivate, enter desired time, and deactivate-on-all-beams functions described above
TIMING SYSTEM Page 4-16 for the individual-sector timing trigger panels. Similarly, it handles the corresponding functions on the klystron timing panels (and on any other panels where this functionality is needed). T_MATRIX_ADJUST calls a routine TIMEUNIT_FILL to obtain some database information about the selected DUPCD unit(s) and store it in a common block. Then T_MATRIX_ADJUST calls TIME_BTN_HANDLER if one of the timing fucntion buttons (e.g. activate, deactivate, etc.) has been pushed.
4.4.2 TIME_BTN_HANDLER This routine handles the buttons that actually change T_MATRIX value(s) (or in certain cases, e.g. for TRBR's, database value(s)) for the selected device(s). The actual work of updating the TMATRIX and the PDU (or PAU, or PSU beam matrix in the micro) are done by calling the appropriate timing utilities.
4.4.3 T_MATRIX_KNOB This routine takes care of knob assignment, rotation, and deassignment on the sector trigger and klystron panels, as well as on any other panels where it is desired to assign a timing knob. It is permitted to assign ALL* units belonging to a DUPCD primary (e.g. TRIG or KLYS) to a knob. When the knob is turned, the T_MATRIX element(s) are updated and then a message is sent to the micro telling it to update the corresponding elements in the PDU internal memory (or the PAU internal memory, or the PSU beam matrix in micro memory) The actual work of updating the TMATRIX and the device are done by calling timing
TIMING SYSTEM Page 4-17 utilities.
4.4.4 KTRG_PNL This is the routine that handles the klystron and subbooster timing panels (just as T_MATRIX_ADJUST handles the trigger timing panels). Like T_MATRIX_ADJUST, it calls TIMEUNIT_FILL and TIME_BTN_HANDLER.
4.4.5 DEVICE_ACTIVE_DISP This routine creates the display showing the activity of selected DUPCDs on all beams. A '*' is displayed if the device is active on the beam, and a blank is displayed if it is not active on the beam.
4.4.6 TIMING_DISP This routine creates the display showing timing data for selected DUPCDs on a selected beam.
4.4.7 DEVICE_TIME_DISP This routine displays the timing values for the selected DUPCD for all beams on which it is currently active. There are also special branches in this routine to permit it to be used for TRBR's (which function independently of beam code), and for VDU's and TGAS's (each of which is essentially a vernier device that adds a small increment to the time output by its associated PDU channel.
TIMING SYSTEM Page 4-18
4.4.8 TIME_DIAGNOSTICS_PANL Handles the database displays, PDU channel allocation display, reinitialize PDU function, and PDU unit select on the timing diagnostics panel.
4.4.9 PDUXPGM, PDU_GETDELAY, PDU_GETPP, PDU_READ_PDU, And PDU_READ_STB These routines support the PDU diagnostic that compares the time values in the T_MATRIX, the time values inside the PDU, and the actual time values as seen through the STB.
4.4.10 BEAM_DISPLAY The routine generates the MPG rate and MPG code displays
4.4.11 BCOD_PNL And BCOD_DISP These are the panel handler and display routines used by the beam rate control panel.
4.5 BASE RATE TRIGGERS (TRBR'S) The database primary TRBR is the logical "device" associated with a base-rate (mode 6) PDU channel, just as the primary TRIG is a logical "device" associated with a program mode (mode 1,3, or 5) PDU channel. TRBR data is NOT kept in the T_MATRIX, since the T_MATRIX is indexed by beam codes and the output of a TRBR follows a repetitive pattern
TIMING SYSTEM Page 4-19 that is independent of the beam codes broadcast by the MPG. However, the exact analog of a T_MATRIX value is kept in the PDUN secondary under the primary TRBR. The pattern according to which this value is output by the PDU channel is determined by the TMSK secondary. The TRBR primary also has a secondary PDUT similar to that for TRIGs. Namely, the "standard" activate value for the TRBR is: TREF(of the PDU) + PDUT(of the TRBR) Note that T_NOMINAL values are ignored as far as TRBRs are concerned. The functions supported for TRBRs are similar to those for TRIG, KLYS,etc.): o Activate: Set to nominal value (PDUN = PDUT) and update PDU channel o Deactivate: Set the usual high order bit in PDUN, and update PDU channel o Reactivate: Remove the usual high order bit in PDUN, and update PDU channel o Enter desired value in nsec w.r.t. TREF, and update PDUN and the PDU channel o Change PDUN with a knob, updating PDU channel These functions are supported by branches in the following routines:
TIMING SYSTEM Page 4-20 o TIMBTNHND (call TRBR utilities where appropriate) o TIMEUNITFILL o TMATADJ (since TRBR's are supported on the normal trigger panels) o T_MATRIX_KNOB (separate branch(es) for TRBRs, which can use the same knob assign buttons used by TRIGs and other DUPCDs. The TRBR utility routines are: TRBR_GET TRBR_PUT TRBR_ACTIVATE TRBR_DEACTIVATE TRBR_REACTIVATE For details on these routines, see the utilities chapter in BUG.
4.6 THE VERNIER DELAY UNIT (VDU) The VDU is a device that receives input from a PDU channel and produces an output at a small specified increment of time later. Since the VDU has a very limited range (about 10 nsec), the PDU channel time as well as the VDU setting must change in a coordinated way when one requests an output at a specified delay with respect to the fiducial.
TIMING SYSTEM Page 4-21 It is not necessary to support the standard activate, deactivate, and reactivate functions for the VDU/PDU combination since they are already supported for the PDU channel alone. There is an enter-TDES function for the VDU/PDU combination, so that the user can set the VDU/PDU combination to a selected value before assigning a knob. The knob routine simply checks that the PDU channel is active on the desired beam (and no others) and then allows the knob to move the VDU/PDU combination from wherever it is. There exist the following utilities to read and set the value of a VDU/PDU combination: VDU_PDU_READ(MICR,UNIT,BEAM,NSEC_WRT_STD) VDU_PDU_SET(MICR,UNIT,BEAM,NSEC_WRT_STD) Here UNIT is the db unit number of the VDU. NSEC_WRT_STD is the time in nsec of the VDU/PDU with respect to TREF+PDUT+T_NOMINAL for the DUPCD associated with the PDU channel. The VDU primary has a 1R4 secondary VDES in which the current VDU setting is kept. The VDU register has 0.1 nsec per bit and a total range of 10.5 nsec. The VDES value is stored in units of nsec. The VDES secondary is updated by the above utilities every time the VDU is read or set. Also, the routine VDUINIT in the micro (called upon crate initialization) sets the VDU register according to the current database value of VDES. The VDU_PDU_SET routine sends a message to the micro, where another routine does the CAMAC operations and much of the other work.
TIMING SYSTEM Page 4-22
4.7 TRIGGER GATE AND SYNCHRONIZER (TGAS) There is another device, the Trigger Gate And Synchronizer (TGAS) CAMAC module, which produces a (gated) vernier delay of a PDU trigger by synchronizing it to a 178.5 MHz signal whose phase is controlled by a DAC. The TGAS+DAC combination is thus somewhat analogous to a VDU, in that it makes a fine adjustment to the time of a trigger produced by a PDU channel. Enter-TDES and knobbing are supported for the TGAS/PDU, via the following utilities (analogous to those mentioned above for the VDU/PDU): TGAS_PDU_READ(MICR,UNIT,BEAM,NSEC_WRT_STD) TGAS_PDU_SET(MICR,UNIT,BEAM,NSEC_WRT_STD) The TGAS_PDU_SET routine sends a message to the micro, where another routine does the CAMAC operations and much of the other work. It is important to do the CAMAC from the micro rather than using transparent CAMAC from the VAX, so that all the CAMAC operations can be put into a single package. A TGAS initialization routine (TGAS_INIT) exists in the crate job in the micro. This routine sets up the TGAS and DAC in accord with the current database values for :VDAC: and :EDGE:.
4.7.1 Details Of Algorithm The leading edges of the 178.5 MHz waveform move backwards in time one full cycle as the DAC setting goes from 8080H to FF80H (on channel 2
TIMING SYSTEM Page 4-23 at least). The TGAS takes the PDU input trigger and shifts it so that the TGAS output is synchronized to a leading edge of the 178.5 MHz waveform. The PDU input is first resynchronized to either the leading or falling edge of the 119 MHz clock, depending on the value of :EDGE:. The output of the TGAS then occurs at the time of the first 178.5 MHz leading edge following the resynchronized PDU input. The algorithm for setting the TGAS/DAC/PDU combination is contained in the micro timing job routine TGAS_WR, which should be consulted for details. However the basic ideas are as follows: Let NSEC_WRT_STD = desired time in nsec w.r.t. TREF + T_NOMINAL + PDUT and let PDU_TICKS_STD = standard time TREF+T_NOMINAL+PDUT (in ticks). Then NSEC_WRT_STD = (an even number of PDU ticks)/0.119 + (U_119 + 0.5*EDGE)/0.119 + FR_NSEC where U_119 = 0 or 1 ticks EDGE = 0 or 1 depending on whether TGAS resynchronizes to falling or leading edge of the 0.119 MHz waveform FR_NSEC = Leftover fractional part of 0.119 MHz cycle (in nsec) One wants to keep the output as smoothly varying as possible as the
TIMING SYSTEM Page 4-24 PDU ticks, the value of EDGE, and the DAC voltage are juggled. Thus, the change from one value of EDGE to the other is done when adjacent leading and falling edges of the 119 MHz wave form are symmetrically centered between the two leading edges of the 178.5 MHz waveform. Also, the jump from one end of the DAC's range to the other is done at a seleted place where the polynomial is supposed to give a smooth result (?). The conversion between DAC voltage and nsec is quite nonlinear (the conversion polynomial VCNV has 6 terms) There are roughly 10 DAC volts per cycle of 178.5 MHz.
4.8 TIME JOB IN THE MICRO The TIME job contains three tasks: a background task, a normal pattern interrupt task, and an error pattern interrupt task. The normal pattern interrupt task does programming of pulse class devices such as PDU's (programmable delay units) and PAU's (pulsed amplitude units) on a pulse to pulse basis. The error pattern interrupt task handles interrupts caused by error patterns. The background task, running at lower priority, performs all other functions of the TIME job. At start-up, the main things done by the TIME job are the following: o Download the data from the appropriate sections of the T_MATRIX to the micro. The section of the T_MATRIX that contain timing data for a particular Pulse Class Device (PDU, PAU, or PSU) in a particular micro will sometimes be referred to as the "beam matrix" for that device.
TIMING SYSTEM Page 4-25 o Initialize the PDUs, PAUs, and PSUs. o Initialize the PPYYNMI routines, which allow other subjobs to request that certain of their own routines be executed at NMI level. o Create the error interrupt task. o Set up and turn on the pattern interrupt handler. In the following sections, the downloading of T_MATRIX data and the initialization of the timing devices are discussed in more detail.
4.8.1 Downloading Of T_MATRIX Data The downloading of data for PDUs and PAUs differs somewhat from that for PSUs, because the beam matrices are stored internal to the PDUs and PAUs but must be kept in an array in the micro for the PSUs. Thus the crate job needs to have a mechanism for reacquiring new T_MATRIX data not only when the micro is IPLed but also whenever the PDU and PAUs in a crate need to be reinitialized. For PDUs and PAUs, the downloading of data is initiated by a message from the crate subjob in the micro (specifically, from routine CRATE_INIT) to PARANOIA. For PSUs, the downloading of data is initiated by a message from the routine PSU_SETUP (in the timing job) to PARANOIA. In all cases, PARANOIA then sends the data from the T_MATRIX to the timing job in the micro, by calling the timing utility routine TIME_SEND_DATA. PARANOIA sends the data for one PDU or PAU at a time, and the appropriate timing job initialization routine (PDU_INIT or PAU_INIT) is called for that device. PARANOIA sends the data for all the PSUs
TIMING SYSTEM Page 4-26 together, and the data is stored in the micro by the routine PSU_RCV_DATA. The CAMAC commands that initialize the PSU are done from the routine PSUINIT.
4.8.2 Initialization Of PDU's Upon receipt of the data from the T_MATRIX, the timing job routine PDU_INIT gets the rest of the data it needs to put into the PDU (recall that not all 16 PDU channels necessarily have data in the T_MATRIX --- only "PP channels" do) Once all the data has been obtained for a PDU, PDU_INIT can do the CAMAC commands to initialize the PDU: F(9) : Disable backplane drivers and LAM; Set all 16 channels in mode select table to reuse value; Set all entries in Pattern Timing Table reuse locations to 0FFFFFH Set up for each channel n that is to be fired on PP: Initialize pattern timing table pointer register (PTTPR) for channel n: F(17)A(0) Data: n 0 ------------ Set up mode select table entry for channel n:
TIMING SYSTEM Page 4-27 F(17)A(1) Data: 001,011, or 101, depending upon whether pattern input register 0,1, or 2 will be used. Write values into PTT for channel n: F(16)A(0) Data: 19-bit timing values for channel n (N_BEAMS or 254 values, depending on whether entire table was initialized to 07FFFFH. Also must put reuse value into 255th slot if value other other than 07FFFFh is desired.) Set up for each channel m that is purely a reuse channel: Initialize PTTPR : F(17)A(0) Data: m F F ------------ Set up mode select table entry for channel m: F(17)A(1) Data: 111 Write value into PTT for channel m: F(16)A(0) Data: 19 bit reuse value for channel m
TIMING SYSTEM Page 4-28 Set up for each channel q that is to be fired on YY: Initialize PTTPR : F(17)A(0) Data: q 0 ------------ Set up mode select table entry for channel q: F(17)A(1) Data: 000,010, or 100 Set up for each beam-pattern-independent channel s using time slot counter: For each location x in channel s of the PTT: Initialize PTTPR: F(17)A(0) Data: s x (x must be between ------------ 1 and 36) Write value into PTT: F(16)A(0) Data: 19 bit timing value Set up mode select register: F(17)A(1) Data: 110
TIMING SYSTEM Page 4-29 Read-back of data in pattern timing table and mode select table F(26)A(1) : Enable backplane drivers
184.108.40.206 Initialization Of The PAU - The routine PAU_INIT receives the T_MATRIX data and does CAMAC commands to initialize the PAU in a way that is analogous to the way PDU_INIT initializes PDUs. It then sends a message to the MGNT subjob so that it can do its part of the PAU initialization. Because the initialization sequence is rather involved, a database secondary called FLAG is kept under the PAU primary. It is updated at each stage of successful initialization so that in case of problems, one can see how far it got.
220.127.116.11 Initialization Of The PSU - Recall that PSUs do not in general just produce a single pulse at a specified delay after the fiducial, but rather produce a train of pulses at the specified delay. The delays are obtained from the T_MATRIX and stored in the micro as described above. The routine PSUINIT simply gets some database information and does the CAMAC commands telling the PSU how many pulses in the pulse train, the spacing between pulses, the width of the pulses, and whether the PSU is to run in programmed or reuse mode.
TIMING SYSTEM Page 4-30
4.8.3 Updating PDU's, PAU's, And PSU's When one changes the T_MATRIX using functions in the SCP, messages are sent to the micro to update the devices accordingly. Such messages are handled by the timing job routine TIMING_UPDATE.
18.104.22.168 Updating The PDU - TIMING_UPDATE calls the routine PTT_SGL_UPDATE or PTT_CHAN_UPDATE to update respectively a single value or an entire single channel of the PDU. 1) Single value, row, or column of beam matrix Initialize (Pattern Timing Table Pointer Register (PTTPR): F(17)A(0) Data: n (pp) ------------ where n=PDU channel index, pp=beam index F(16)A(0) Data: new 19-bit timing value(s) 2) Entire beam matrix Reinitialize the PDU as above
TIMING SYSTEM Page 4-31
22.214.171.124 Updating The PAU - TIMING_UPDATE calls the routine PAU_UPDATE, which updates the entire PAU beam matrix, even if only a single value has actually changed.
126.96.36.199 Updating For The PSU - Nothing needs to be done to the PSU. TIMING_UPDATE just updates the appropriate entry or entries in the PSU beam matrix (the array BEAM_PP_PSU).
4.8.4 Pattern Interrupt Handler The basic functions done by the interrupt handler are the following: o Receives PPYY for the n+2 beam. o Updates the array of PPYY's for the n+2,n+1, and n beams. o Checks to see whether the PP is valid (less than or equal to N_BEAMS, the maximum beam number supported by the software) o Check the flag SKIP. Proceed if SKIP is .FALSE., otherwise skip further processing on this pulse. o Broadcasts these 3 pipelined beam codes to each crate in the micro that contains PDUs and/or PAUs : F(19)A(8) Data=nth PPYY : broadcast nth beam code F(19)A(9) Data=n+1 PPYY : broadcast n+1 beam code F(19)A(10) Data=n+2 PPYY : broadcast n+2 beam code
TIMING SYSTEM Page 4-32 o Sends CAMAC pkg to load PSU's, if there are any: F(16)A(0) Data: Delay value o Call any NMI routines set up by calls to PPYYNMISET