Back to ATR document
  • (Cost/benefit analysis of ADO parameters)
    		ADO parameters for the WFG
    
    		(This is section 4 of: "CONTROL OF MAGNET POWER SUPPLIES IN THE "ATR" TRANSFER LINE" )
    
    
    
    
    4.  ACCELERATOR DEVICE OBJECT "wfgRamp"
    =======================================
    
    The "wfgRamp" ADO is used for initialization, DC ramping, readback-mode
    switching, and all other functions of magnet power supply control for ATR
    preparation and commissioning.  Applications and PET pages (via RPC) execute
    a sequence of "get" or "set" operations to read or write the values of
    parameters that are defined for the ADO.
    
    Selected ADO parameters are described in the following sub-sections and a
    complete list of parameters appears at the end.  An asterisk (*) denotes a
    parameter that is commonly used on the PET page described above.
    
    
    4.1  INITIALIZATION PARAMETER
    -----------------------------
    Before ramping or performing other operations, an WFG channel must first be
    initialized by entering the WFG output width (as defined in section 1.4).
    
        *	_setupTestS	Initialization of the WFG channel is performed
    			  when the width (12,13,16,17) is entered here.
    
    	_widthC		Width of WFG output (12, 13, 16, 17 bits).
    	_maxBinaryC	Maximum output setting =  (2 ^ (widthC-1)) -1;
    	_scaleC		Index of Scale Factor for calculation.
    			  (=24-width.  Stored in Assoc, set by setup.);
    
    Setting _setupTestS to a small positive value (such as 12, 13, 16, or 17)
    specifies the WFG output width, recaluclates the above parameter values,
    and causes the ADO to perform a startup sequence based on WFG configuration
    parameters described in section 4.10.  A negative value also changes the
    _configC array to use an internal timer instead of the 720 Hz event.
    
    
    4.2  CONVERSION (TO ENGINEERING UNITS)
    --------------------------------------
    Optionally, a maximum value in may be given for the WFG output (and
    individually for the readbacks, if necessary), to be used in conversion
    between "raw" WFG values and "cooked" values in engineering units.
    See sections 4.?? and 4.?? for details concerning the raw values and the 
    conversion formulae.  Conversion is governed by these optional parameters:
    
        *	_maxLevelC	   Maximum positive output value in engineering units.
    
        *	_readbackMaxC[10]  Maximum positive value in engineering units for 
    			     each of the readbacks.  (Two groups of 5).
    
    When _setupTestS (or _widthC) is set, these parameters are initialized to the
    "full-scale" count (_maxBinaryC), which is equal to  ( 2 ^ (widthC - 1) ) -1.
    When _maxLevelC is set, the _readbackMaxC array is initialized to the new value.
    
    
    4.3  SETTABLE PARAMETERS FOR DC RAMPING 
    ---------------------------------------
    For simple DC ramping (linearly in a specified time, to a newly specified
    setpoint), the essential parameters are:
    
        *	_newLevelS	Specify each new target setpoint.  [Default is 0.]
    
        *	_rampTimeS	Specify the number of seconds.  [Default is 10.]
    
        *	_doRampA	Action button to start a ramp (if newLevel has been set).
    
    To begin the ramp, the _doRampA parameter must be set to the value "DoIt"
    (which is its only acceptable value).  Note that _doRampA will not accept
    another setting unless a value has been set into _newLevelS (or _newBinaryS)
    since the last setting of _doRampA.
    
    
    4.4  PARMETERS DISPLAYED FOR DC RAMPING 
    ---------------------------------------
    The following parameters are read by the PET page to display the WFG output
    and progress of the ramp:
    
        *	_wCookedM	Read-only display of latest WFG output value
    			(shifted for 12-, 13-, 16-, or 17-bit width; also
    			converted to "cooked" value if _maxLevelC was set.)
    
        *	_exhaustedM	Displays "DONE" when ramp is complete.  Otherwise, 
    			table interval number:  "0" for the first row of a
    			simple ramp table; "/" before clock has started.
    
    
    4.5 READBACK PARAMETERS
    -----------------------
    For a Medium-Resolution power supply interface, the readback mode may be
    changed between group "A" and group "B", and the five readbacks are displayed
    along with their identifiers.  For the Low-Resolution interface, there is
    only one readback and mode switching does nothing.  Note that the WFG cannot
    detect the initial readback mode, but can only set it.  Parameters are:
    
        *	_readbackModeS	Specify readback-mode "A" or "B" (16-bit interface). 
    
        *	_readbackM[5]	The five readback values (if any), "cooked.
    
        *	_readbackIDM[5]	The five readback identifiers (if any).
    
    
    4.6  SAWTOOTHS
    --------------
    Optional parameters may be set to specify "sawtooths" to be performed prior
    to ramping (to avoid the effects of hysteresis).
    
        *	_sawManyC	The number of sawtooths.
    
        *	_sawUpC		The number seconds for rising sawtooth;
        *	_sawHighC	Top of sawtooth;
        *	_sawDownC	The number seconds for falling sawtooth;
        *	_sawLowC	Bottom of sawtooth;
    
    	_sawTableC[4]    Mini-table for one sawtooth.  (Copied repeatedly 
    			  into tableValueS when sawManyC is set > 0.)
    
    
    4.7  TABLES
    -----------
    The following parameters provide access to the F(t) table that is downloaded
    into the WFG.  Note that all values in these tables are "raw", and that that
    the time value is in 720-Hz ticks rather than seconds.
    
        *	_tableValueS[256]  Table values (to be downloaded);
    
    	_tableSizeS	  Set table size & download the table.
    
    When newLevelS is set, the new setpoint value is stored into the last row of a
    table, along with the time (rampTimeS), and the table is downloaded to the WFG.
    Setting tableSizeS also causes the table to be downloaded.  
    
    
    4.8 PARAMETERS CONTAINING RAW VALUES
    ------------------------------------
    Unconverted "raw" values are available in the following parameters:
    
    	_wM		  Latest output value sent by WFG to PS.
    			  (upper 24-bits + 8-bit ID).  
    
            _readbackRawM[5]  Raw values from readbacks.  (24-bits + 8-bit ID).
    
    	_newBinaryS	  New setpoint (in device units)
    			    (Changing this also BUILDS a new F-table.);
    
    	_rampTickS	  Number of ticks for ramp (720 per second).
    
    	_intervalM	  Current row of F-table (0 to max;
    			    max+65536 if done; -1 if no clock).
    
    
    4.9  CONVERSION FORMULAE
    ------------------------
    Conversion between raw and cooked parameter values is defined as follows:
    
    	_newLevelS =  (float)  ( _newBinaryS * _maxLevelC / _maxBinaryC );
    
    	float f = ( _newLevelS * _maxBinaryC / _maxLevelC );
    	if (f >= 0) _newBinaryS = (int) ( f + 0.5 );
    	else        _newBinaryS = (int) ( f - 0.5 );
    
    	_rampTimeS = _rampTickS / 720;
    
    	_rampTickS = (int) (  _rampTimeS  *  720  );
    	if (_rampTickS <= 0)  _rampTickS = 1;
    	       
    
    	_sawTableC[1] = (int)  ( _sawHighC * _maxBinaryC / _maxLevelC );
    	_sawTableC[3] =  (int)  ( _sawLowC * _maxBinaryC / _maxLevelC );
    
    	int wShifted=  _wM >> _scaleC;
    	_wCookedM =  (float) wShifted * _maxLevelC / _maxBinaryC ;
    
            _readbackRawM[index] = aBuffer[index] >> 8;
            rShifted = _readbackRawM[index] >> _scaleC;
            _readbackM[index] = rShifted * _readbackMaxC[m+index] / _maxBinaryC ;
    
    
    4.10  INITIALIZATION DEFAULTS
    -----------------------------
    Optional parameters can modify the initialization defaults.  Prior to
    initialization, the following may be specified to override the defaults:
    
        *   _configS[6]     The WFG configuration array may optionally be entered
    			prior to initialization; otherwise, defaults are used.
    				(timers, , # DMA words).
    
    If the first two words of _configS are zero, the 720 Hz. event will be used.
    To use an internal clock instead, set config[0] and config[1] to 6944 before
    initialization (or set a negative value in setupTestS, to force this).
    
    	_eventCode720	The Event Line index of the 720 Hz. event may be changed
    			prior to initialization.  [Default is event 72 (0x48).]
    
    	_eventC[2]	Event numbers to be used.  [Defaults:  101, 102.]
    	_assocC[2]	Association groups to be used.  [Defaults:  1, 2.]
    	_tableC[2]	Interpolation tables to be used.  [Defaults:  1, 2.]
    
    
    4.11  IDENTIFICATION
    --------------------
    The following read-only parameters display identifying information about the
    WFG channel:
    
    	_firmwareID	Version of the firmware;
    	_hardwareID	Identification of the WFG hardware;
    	_serialID	WFG hardware serial # (from hardwareID);
    	_baseID		First 2 hex digits of 24-bit base addr;
    	_baseAddressC	Base Address (on VME bus) for this VME;
    	_deviceID	Identification of the /dev device;
    	_channelC	Channel number;
    	_ioNameC	Identifies I/O port(s);
    	_debug		Turns on or off certain debugging printouts.
    	_debugD		"
    
    
    4.12 SCOREBOARD ACCESS
    ----------------------
    The WFG "scoreboard" (containing values used in the latest WFG calculation)
    may be accessed using the following parameters:
    
    	_intscoreboardM[64]	Displays the entire scoreboard.
    	_indexScoreboardC[4]	Specify 4 words of scoreboard:  i0,i1,i2,i3
    	_int0M			Display first specified word:  scoreboard[i0]
    	_int1M			Display second specified word: scoreboard[i1]
    	_int2M			Display third specified word:  scoreboard[i2]
    	_int3M			Display fourth specified word: scoreboard[i3]
    
    The entire scoreboard is available in the 64 word array.  If indexScoreboard 
    contains the values 60, 61, 62, and 63, then the other four parameters will 
    contain the last four words of the scoreboard when fetched.
    
    
    
    
    5.  SUMMARY OF PARAMETERS
    =========================
    
    The following table lists all of the parameters defined in the wfgRamp ADO
    as of version 2, which was frozen in October 1995 for the ATR commissioning.
    (The wfgRamp ADO is subject to change after ATR.)
    
    
      MEASUREMENT PARAM.	TYPE	R/W	DESCRIPTION
      -----------------	----	---	-----------
      wM			Long	R-ONLY	Latest W output value sent by WFG to PS.
    					  (upper 24-bits + 8-bit ID) 
      wCookedM		Float	R-ONLY	Latest W in Engineering Units.
      readbackIDM[5]	Long	R-ONLY	Identifiers for readbacks;
      readbackRawM[5]	Long	R-ONLY	Raw readback values.
      readbackM[5]		Float	R-ONLY	Cooked readback values.
      intervalM		Long	R-ONLY	Current row of F-table (0 to max;
    					  max+65536 if done; -1 if no clock).
      exhaustedM		String	R-ONLY	DONE if ramp is complete.
    					  interval, otherwise; "/" in no clock.
    
      ACTION PARAMETER	TYPE	R/W	DESCRIPTION
      ----------------	----	---	-----------
      doRampA		String	R/W	Action parameter to start a ramp.
    					  (Fakes an event & switches tables.);
    
      SETTABLE PARAMETER	TYPE	R/W	DESCRIPTION
      ------------------	----	---	-----------
      readbackModeS		String	R/W	Switch readback-mode (of 16-bit interface).
      rampTimeS		Float	R/W	The number of seconds in the ramp;
      rampTickS		Long	R/W	How many ticks for ramp;
      newLevelS		Float	R/W	New setpoint (in Engineering Units).
    					  (Changing this BUILDS a new F-table.);
      newBinaryS		Long	R/W	New setpoint (in device units)
    					  (Changing this BUILDS a new F-table.);
      tableValueS[256]  	Long	R/W	Table values (to be downloaded);
      tableSizeS		Long	R/W	Set table size & download the table.
      sawTableC[4]		Long	R/W	Mini-table for one sawtooth.  
    					  (SawUp, SawHigh, SawDown, sawLow.);
      sawManyC		Long	R/W	How many sawtooths (if any);
      sawUpC		Float	R/W	The number seconds for rising sawtooth;
      sawHighC		Float	R/W	Top of sawtooth;
      sawDownC		Float	R/W	The number seconds for falling sawtooth;
      sawLowC		Float	R/W	Bottom of sawtooth;
    
    
      INITIALIZATION	TYPE	R/W	DESCRIPTION
      --------------	----	---	-----------
      setupTestS		Long	R/W	Initialize the WFG for DC ramping.
    					  Indicate width of output:  12, 13, 16, 17.
      widthC		Long	R/W	Width of WFG output (12, 13, 16, 17 bits).
      scaleC		Long	R/W	Index of Scale Factor for calculation.
    					  (=24-width.  Stored in Assoc, set by setup.);
      maxBinaryC		Long	R/W	maximum output setting =  (2 ^ (widthC-1)) -1;
      maxLevelC		Float	R/W	Level represented by full-scale.
      readbackMaxC[10]	Float	R/W	Max range for each readback (2 groups of 5).
    
    
      CONFIGURATION		TYPE	R/W	DESCRIPTION
      -------------		----	---	-----------
      configC[6]		Long	R/W	Configuration parameters 
    					  (timers, , # DMA words).
      eventCode720C		Long	R/W	Timeline event code for 720 Hz event.
      eventC[2]		Long	R/W	List of events used;
      assocC[2]		Long	R/W	List of assocs used;
      tableC[2]		Long	R/W	List of tables used;
    
    
      IDENTIFICATION	TYPE	R/W	DESCRIPTION
      -------------------	----	---	-----------
      firmwareID		String	R-ONLY	version of the firmware;
      hardwareID		String	R-ONLY	identification of the WFG hardware;
      serialID		String	R-ONLY	WFG hardware serial # (from hardwareID);
      baseID		Long	R-ONLY	First 2 hex digits of 24-bit base addr;
      baseAddressC		Long	R-ONLY	Base Address (on VME bus) for this VME;
      deviceID		String	R-ONLY	identification of the /dev device;
      channelC		Long	R-ONLY	channel number;
      ioNameC		String	R-ONLY	Identifies I/O port(s).;
      debug			Long	R/W	Debug flag.
      debugD		Long	R/W	Debug flag.
    
    
      SCOREBOARD ACCESS	TYPE	R/W	DESCRIPTION
      -----------------	----	---	-----------
      intscoreboardM[64]	Long	R-ONLY	Scoreboard (64 words).
      indexScoreboardC[4]	Long	R/W	Indexes to extract from scoreboard.
      int0M			Long	R-ONLY	Extract integer from current scoreboard.
      int1M			Long	R-ONLY	Extract integer from current scoreboard.
      int2M			Long	R-ONLY	Extract integer from current scoreboard.
      int3M			Long	R-ONLY	Extract integer from current scoreboard.
    
     Back to ATR document 
    
    
    Click here for an analysis of WFG ADO parameters