Proposal for Handling Switching Signals in the GBT

Mark H. Clark

June 13, 2000

Goal

Fully and consistently annotate all scan FITS files according to the switching signals' configuration, and provide a common interface for specifying switching signal behavior.

Overview

Switching signals are inter-device binary signals which during a scan alter the signal characteristics of the IFs received by backends.  The three primary switching signals are SigRef, Cal, and Blanking.  All backends can generate these signals and the LO1, receivers, and some backends can respond  to various subsets of the signals.   The SwitchingSignalSelector controls the routing of four switching signals between devices: the three primary signals plus AdvSigRef.  When using multiple backends only one backbend can generate the signals, i.e., be master, and the other must be slaves.

Roger Norrod defined the hardware implementation in a note of May 6, 1998:
 
Signal HIGH LOW
Sig/Ref signal (normal) reference
Cal off on
Blanking data invalid data valid

Problems

Phase  Description

To set up and run a scan, one only needs to specify the desired switching signals' behavior to the master device and the routing to the SwitchingSignalSelector  -- which is how the mockup has been used to date. However, this results in only the master knows the definitions of the states of the switching signals in each phase.  Slave devices have no switching signal phase information, and therefore cannot report in their FITS files -- for either backend observation files or data associated parameter files from Samplers -- any phase information about the switching signals.

Phase Specification

Each device specifies its switching signals' sequences differently including  parameter name, type, and meaning as the following table shows.  Data types are in parentheses.
 
 
parameter spectral processor spectrometer & # LO1 DCR @ # !
phase start phaseStart
(double)
phaseStart
(double)
PhaseStart
(double)
sig/ref sigRefState
(Sig/Ref)
cycles_per_sig_ref_period
cycles_per_sig_phase (int)
sigRefState
(Sig/Ref)
SigRef
(REF,SIG)
cal calState
(Off/On/Undefined)
cycles_per_cal_period
cycles_per_no_cal_phase (int)
calState
(Off/On)
Cal
(OFF/ON)
blanking blankState
(NotBlank/Blank)
cycles_per_blank_period
cycles_per_blank_phase (int)
blankState
(NotBlank/Blank)
Blanking $
(double)
period reqSwitchPeriod
(double)
reqSwitchPeriod
(double)
CycleTime
(double)
phases reqNumPhases
(int)
PhasesPerCycle %
(int)

& a signal's specification must consist of one phase shift whose first phase is high
% maximum of 10 phases
@ has 6 switching signals available beyond the primary set
$ blanking is not defined by a separate phase, but by a latency in seconds at the start of each phase
# can act as slave backbend
! can generate advanced sig/ref
Note: all receivers respond to the cal signal and some to the sig/ref signal.

Starting Scans

As discussed at a meeting on July 7, 1998 and summarized in a mail message by John Ford on July 9, 1998, there is a problem with coordinating switching signals with the beginning of scans because of an inconsistency in the software and hardware implementations.  I quote from John's message:
Most discussion centered around how to handle a switching signal waveform that has a transition at T=0.  This is most important in the case of the slave devices, the LO1 system in particular.  The problem here is that the slaves are all synchronized to a common wall clock, but the jitter in the software timing may be a few milliseconds.  In the case of the LO, it is troublesome to have a switching signal transition in the vicintity [sic] of T=0, because the LO must follow a pre-programmed sequence of frequencies, and it switches from one to the next on the edge of a switching signal transition.  If a switching signal is changed at T=0, there is an uncertainty as to whether the LO should step to the new frequency or not.
The solution which best conforms to the philosophy intent of Ygor is for devices to set their states for switching signals for the first phase prior to the start of scan and then allowing the first transition to occur after the scan starts between the first and second phases. The only device that does not behave in this manner is the DCR, however the cost for fixing it was deemed too high, so in lieu the following rule by Rick Fisher was proposed:
 
Masters are free to change the switching signals any time up to and including the start time (T0).  Slaves are responsible for ignoring the transitions during a quiescent period, q, if necessary for the proper operation of the slaves.  The period q shall be divided into a period q- , that time before T0, and q+, that time after T0 before the slave will act on the switching signal transitions.  The period q- shall not exceed 100ms, and the period q+ shall not exceed 20 ms. Every effort should be made to minimize q+.
In practical terms for the GBT, this rule only affects the LO1 when slaved to the DCR because the LO1 is the only device sensitive to transitions of switching signals rather than their state and the DCR is the only device that generates transitions at the start of a scan. The LO1 can be made to abide by the rule by inhibiting interrupts during the quiescent period. I hope though, that this rule is only used to patch the current situation, but in general devices which can be masters will not generate transitions at the start of scans.

Proposal

To ensure consistency in setup information across the telescope, the following ControlParameters will be defined in a header file and made available throughout the system for constructing input switching signal ControlParameters, including the ScanCoordinator  which will pass the values on to all switching signal devices involved in a scan.
 
Name type values description
phase_start double[number_phases] 0.0 <= phase_start < 1.0 start of phase as a fraction of the period
sig_ref_state enum[number_phases] Sig, Ref state during phase
cal_state enum[number_phases] NoNoise, Noise state during phase
blanking double[number_phases] 0.0 <= blanking < phase length latency at start of phase
switch_period double 0.0 < switch_period total time in seconds of one iterations of phases
number_phases int 0 < number_phases number of phases in one switch_period

These are the user-specified switching signal Parameters.  Any device that is required to  generate these signals may need to modify the values of phase_start and switch_period because of its device-specific characteristics, but these changes must be reflected in other computed Parameters (requested vs. actual Parameters) and in the FITS  STATE table described below.  However, the device must satisfy the number and state definitions of all phases.

Backends' data files will include a STATE table  describing the switching signal phases in a binary table as described in Glen Langston's Spectrometer note  of June 25, 1999:

STATE Table
===========

The spectrometer state describes the state of the calibration and
switching signals input to the spectrometer.  The STATE table is accessed
via indexes associated with the individual spectra in the SPECTRA table.  
When calibrating the data the definitions of the states are used
to determine times when the calibration signals are on or off and
when processing a signal or reference spectrum.

The Keyword NAXIS2 is the number of rows in the table and defines the 
number of states of the spectrometer during an integration, usually a 
power of 2.  Below the STATE table columns are described.

Column     Definition
========   ==========
BLANKTIM   Double precision seconds of blanking (ignoring) of data
           before the start of the integration.
PHASETIM   Total time in this state (seconds), including BLANKTIM.
SIGREF     Signal-Reference beam indicator.  Value  0 indicates
           signal beam, value 1 or higher indicates a reference location.
CAL        Indicates that the switching CAL noise diode was on during the
           this state of the spectrometer integration.  Value  1 or higher
           indicates CAL signal was on.  Value 0 indicates the CAL signal off.
SWSIG1     Additional spectrometer internal and external switching signal
..         states are specified by addition of up to 6 (optional) columns.
SWSIG6     Different numbers of columns will be present for different types
           of observations.
Note that the column name SIG-REF has been changed to SIGREF.  Columns may be added or removed for other backends depending on the information available, e.g., the SpectralProcessor adds the columns FFTS and DELETED. Times and phase starts will be represented by doubles (D) and states by bytes (B).

Wherever possible Samplers whose values are dependent on switching signal values will  contain not only a TimeStamp and requisite data fields in each row, but also the phase state causing the change in value.  For example in the LO1:

XTENSION= 'BINTABLE'           / binary table extension
BITPIX  =                    8 / 8-bit bytes
NAXIS   =                    2 / 2-dimensional binary table
NAXIS1  =                   12 / width of table in bytes
NAXIS2  =                    1 / number of rows in table
PCOUNT  =                    0 / size of special data area
GCOUNT  =                    1 / one data group (required keyword)
TFIELDS =                    2 / number of fields in each row
TTYPE1  = 'DMJD    '           / label for field   1
TFORM1  = '1D      '           / data format of field: 8-byte DOUBLE
TUNIT1  = 'd       '           / physical unit of field
TTYPE2  = 'synthesizer'        / label for field   2
TFORM2  = 'J       '           / data format of field: 4-byte INTEGER
TUNIT2  = 'Hertz   '           / physical unit of field
TTYPE3  = 'SIGREF  '           /
TFORM3  = 'B       '           / where 0 signifies Sig and 1 Ref
EXTNAME = 'frequency'          / name of this binary table extension
COMMENT   DMJD: time sample taken;
COMMENT   synthesizer: measured frequency of adjustable synthesizer;
COMMENT   SIGREF: phase state of Sig/Ref signal;

END