Go to bottom of page
6.1 HARDWARE DESCRIPTION . . . . . . . . . . . . . . . 6-1
6.1.1 Individually Shunted Magnets . . . . . . . . . . 6-1
6.1.2 Series Magnets . . . . . . . . . . . . . . . . . 6-2
6.2 DATABASE STRUCTURE . . . . . . . . . . . . . . . . 6-3
6.2.1 Large Power Supply Controller . . . . . . . . . 6-3
6.2.2 Individually Shunted Magnets Controlled By An
188.8.131.52 Calibration: . . . . . . . . . . . . . . . . . 6-4
184.108.40.206 Standardization: . . . . . . . . . . . . . . . 6-5
220.127.116.11 Check And Trim: . . . . . . . . . . . . . . . 6-5
6.2.3 Series Magnets Without Individual Control . . . 6-5
6.3 CAMAC COMMANDS . . . . . . . . . . . . . . . . . . 6-6
6.3.1 Addresses And Function Codes . . . . . . . . . . 6-6
6.3.2 Analog Output In The Micros: . . . . . . . . . . 6-6
6.3.3 Analog Input In The Micros: . . . . . . . . . . 6-6
6.4 ON/OFF/REVERSE CONTROL . . . . . . . . . . . . . . 6-7
6.4.1 Control Structure . . . . . . . . . . . . . . . 6-7
6.4.2 Error Checking: . . . . . . . . . . . . . . . . 6-7
6.4.3 Camac Functions: . . . . . . . . . . . . . . . . 6-8
6.4.4 LGPSCNTL Procedure: . . . . . . . . . . . . . . 6-9
6.4.5 BULKCNTL Procedure . . . . . . . . . . . . . . 6-11
6.4.6 DEGAUSS Subroutine . . . . . . . . . . . . . . 6-12
6.5 MAGNET CONTROL IN THE MICROS . . . . . . . . . . 6-13
6.5.1 Initialization . . . . . . . . . . . . . . . . 6-13
6.5.2 Magnet Control . . . . . . . . . . . . . . . . 6-13
6.5.3 Calibration . . . . . . . . . . . . . . . . . 6-14
6.5.4 Standardization . . . . . . . . . . . . . . . 6-15
6.5.5 Check And Trim . . . . . . . . . . . . . . . . 6-16
6.5.6 LGPSCHK . . . . . . . . . . . . . . . . . . . 6-16 CHAPTER 6 LARGE POWER SUPPLY CONTROLLER
6.1 HARDWARE DESCRIPTION The Large Power Supply Controller is a single width CAMAC module capable of controlling and monitoring a single large power supply. It contains a 14 bit DAC which supplies the set point of the power supply and a 14 bit ADC which reads the current through a shunt monitoring the current output of the supply. In addition, it has several special features including a programmable ramping rate (.532 to 136.3 sec), ripple monitoring, self-test capability, and several protection features. For more information, refer to The large power supply controller is used to control a series string of magnets. There are two possible configurations:
6.1.1 Individually Shunted Magnets The shunted magnets have individual bypass shunts which can be controlled by one channel of a TRANSIAC 3016 16 bit DAC to shunt ______________________________ For more information, refer to: Specification of Power Supply Controller-Monitor Module by D. Horelick and H. Kang.
LARGE POWER SUPPLY CONTROLLER Page 6-2 current between 0 and 15 amps. The bypass current is monitored by a channel of a Smart Analog Monitor(SAM - #123-603). The current through a shunted magnet is equal to the current output by the power supply minus the current through the shunt as set by the DAC and measured by the SAM. Schematically, ------/------------- SHUNTED MAGNETS | | | | | | ____ | | | | |\ | | |LGPS|--/--| >---^^^^---------^^^^----...-------^^^^---- |____| |/ | | | | | | ---| | ---| | | | | s | | s | | | | s | | s | | | | -| | | -| | | | | ||--^^^-| | ||--^^^-| | | | | | | | | | | | | | | | | | | | | | | SAM DAC SAM DAC | | | | | | | | | |__________________________________________|
6.1.2 Series Magnets The series string magnets have no shunts and no individual readback or control. The current through each magnet is equal to the current output by the power supply.
LARGE POWER SUPPLY CONTROLLER Page 6-3 Schematically, ------/------------- SERIES MAGNETS | | | | | | ____ | | | | |\ | | |LGPS|--/--| >---^^^^-------^^^^----...-----^^^^---- |____| |/ | | | | | |______________________________________|
6.2 DATABASE STRUCTURE
6.2.1 Large Power Supply Controller The large power supply controller is entered in the database as a new primary LGPS (hereafter referred to as LGPS). It includes the same set of secondary names as a standard magnet, eg. QUAD, and can be calibrated, standardized, checked, and trimmed with the standard magnet control commands. In addition, three new secondaries are required: :RAMP: 32,1,1I2; !ramping rate code (0-7) :MAGS: 33,1,VI2; !list of magnets on this power supply 2 words each, eg. %QUAD,21 where %QUAD is the category number of QUAD and is defined as a symbol in DEFAULTS.DBS and 21 is the unit number :IDES: 34,3,1R4; !desired current calculated by the micro If the LGPS controls individually shunted magnets (see a above), it has the Hsta_shunted bit ON in HSTA. It has, properly speaking, no magnetic field associated with it, so it is set in terms of the current required by its shunted magnets. It has, for convenience, the same secondary names as a standard magnet, but all secondaries
LARGE POWER SUPPLY CONTROLLER Page 6-4 referring to field really refer to current, ie. BACT is really IACT, etc. Its I vs B polynomial, IVBU, is 0,1. Its set point, IDES, is calculated by the micro and BDES is meaningless. If the LGPS controls series magnets without individual shunts, (see b above) it has an I vs B polynomial which is typical of the polynomials of the individual magnets. Its set point, BDES, is specified by the SCP, and IDES is meaningless.
6.2.2 Individually Shunted Magnets Controlled By An LGPS These magnets have individual shunts with independent readback and control. They are entered in the database under the appropriate primary, eg. QUAD, with the standard set of magnet secondary names. In addition, one new secondary is required: :PSCP: 31,1,1I2: !unit number of the LGPS These magnets have the Hsta_shunted bit ON in HSTA to indicate that they are shunted magnets. They can be controlled with the standard magnet control commands, with the following considerations:
18.104.22.168 Calibration: - During calibration of shunted magnets, the LGPS must be set to the maximum operating current of the magnet string. If the LGPS is to be calibrated as well, it is done separately before calibrating the shunts. The max and min calibration current limits for the magnets
LARGE POWER SUPPLY CONTROLLER Page 6-5 represent max and min shunt currents.
22.214.171.124 Standardization: - The shunted magnets cannot be individually standardized; all magnets on an LGPS are standardized at once. During standardization, all shunts must be set to min to run full current through the magnets.
126.96.36.199 Check And Trim: - The current readback measures the shunt current so the actual current in the magnet is equal to the current in the LGPS minus the current read.
6.2.3 Series Magnets Without Individual Control These magnets have no readback or control and no individual shunts. They are entered in the database as new primaries, eg. BEND,QF,QD,SEPT. As they cannot respond to any of the standard control functions, they require only a limited number of secondaries: :Z : 23,4,1R4; !Z position of the magnet :PSCP: 31,1,1I2; !Unit number of the LGPS controller :LABL: 36,4,2A4; !Serial number or other label for the magnet :IVBU: 2,4,VR4; !I=F(B) going up :IVBD: 3,4,VR4; !I=F(B) going down :BACT: 15,4,1R4; !B at last check The I vs B polynomials are for reference only. The actual polynomial used to set the magnets is a composite and is in the LGPS definition.
LARGE POWER SUPPLY CONTROLLER Page 6-6
6.3 CAMAC COMMANDS
6.3.1 Addresses And Function Codes All Camac functions to the LGPS use the basic CTLW found in the secondary DACL, which contains the crate and module address bits. The branch is simply the micro name, e.g. 'LI01'. The appropriate function and subaddress codes for individual read, write, or test functions are parameters in the include file LGPSCNTL.
6.3.2 Analog Output In The Micros: All analog output to the magnets or LGPSes uses the function DACSET(DACL,DAC,MASK,STAT,PTRBFLAG) where DACL is the CTLW for the DAC DAC is the desired DAC setting MASK is a mask of bits used by this DAC STAT is the returned magnet status PTRBFLAG is a flag indicating if the value of DAC is absolute or incremental DACSET is identical for all magnets or LGPSes.
6.3.3 Analog Input In The Micros: All analog input from the magnets uses the function READADC(READTYPE,WAITFLAG) where READTYPE is a parameter defined in SHNTCNTL = Set_Lgps for LGPS read = Set_Shnt for normal magnet read = Set_All for both LGPS and other magnets WAITFLAG is a flag to indicate if a Sleep is required before reading the ADC
LARGE POWER SUPPLY CONTROLLER Page 6-7 If requested, magnets are read first; shunted magnets need no special consideration. When an LGPS is being read, READADC first loops checking ramping status, and then reads the LGPS ADC's only when ramping is completed. On initialization, READADC assigns its own internal ADC pointer, ADCP, for each LGPS. The database value of ADCP for an LGPS is 0.
6.4 ON/OFF/REVERSE CONTROL
6.4.1 Control Structure A large power supply is turned on or off or reversed ONLY by a SCP and ONLY in response to a touch panel command input. The control is handled by subroutine LGPSCNTL which is called from MAGDRVR. The power supply sector and unit number and the control function to be performed are selected on the appropriate sector magnet control panel, and transmitted to LGPSCNTL in the common block MAGUNITS found in the include file MAGUNITS.
6.4.2 Error Checking: All write functions are followed by a readback and the data is checked for validity. X and Q are expected for valid functions. On any write, read, or check error, a message is printed indicating where the error was detected, the Hsta_sick bit is turned on in the LGPS HSTA word, and the procedure is terminated.
LARGE POWER SUPPLY CONTROLLER Page 6-8 If the Enable bit is ON when the error occurs, an attempt is made to turn it OFF before termination.
6.4.3 Camac Functions: All Camac is handled by the function LGPSCAM with entry points o LGPS_CAMINIT(BRCH,CTLW) where BRCH = Camac branch CTLW = CAMAC control word for the LGPS This sets up the Camio package to be used by the other functions. o LGPS_CAMCHK(FUNCTION,SUBADR,DATA,MASK,ERRMSG) where FUNCTION = Camac read function code SUBADR = Subaddress for this function DATA = Data to be written out MASK = Mask of bits to be checked on readback ERRMSG = Character string to label error messages This writes data, reads back, and checks that the data read back equals data sent. (Note: This function explicitly uses the hardware design feature that a Write operation is performed by the Read function code + 16.) o LGPS_CAMOUT(COMMAND,MODE,ERRMSG) where COMMAND = Mask of bits to be written to the Digital output register MODE = String 'ON' or 'OFF' specifying action taken ERRMSG = Character string to label error messages This reads the contents of the digital output register, turns ON or OFF the new command bits, and writes it out.
LARGE POWER SUPPLY CONTROLLER Page 6-9 o LGPS_CAMSTAT(STATMASK,VALUE,TIMEOUT) where STATMASK = Mask of bits to be tested VALUE = Desired value of tested bits TIMEOUT = maximum number of milliseconds to wait This reads the contents of the digital output/status register and compares the contents of the bits masked by STATMASK with the value specified in VALUE. If the status read is not correct, CAMSTAT loops up to TIMEOUT milliseconds testing for good status. A decoded error message is printed for each incorrect bit. o LGPS_CAMTST This loops through the 14 bits of the DAC and ADC, writing to the DAC, reading back the ADC, and checking readback against preset tolerances. The test uses first a walking bit and then a walking zero pattern. At each step, the DAC readback is also checked against the data written. (After setting the DAC, there is a 230 msec wait necessary before reading the ADC.) o LGPS_RAMPTST(RAMP) where RAMP = Ramping code (0-7) This loops testing ramping status up to a maximum ramping time specified by the ramping code.
6.4.4 LGPSCNTL Procedure:
LARGE POWER SUPPLY CONTROLLER Page 6-10 1. Get database information HSTA,DACL,RAMP for this unit and turn off old status summary bits in HSTA 2. Set up Camio package with LGPS_CAMINIT 3. Check Local/Remote status bit with LGPS_CAMSTAT If not Remote, print error message and continue 4. Set DAC to 0 and check with LGPS_CAMCHK 5. Test ramping status and wait for Q=1 with LGPS_RAMPTST 6. If function requested is On, o Set ramp rate register to RAMP and check with LGPS_CAMCHK o Select Self-test for ADC input and check with LGPS_CAMCHK o Write 0 to ramp register and check with LGPS_CAMCHK o Cycle through test with LGPS_CAMTST o Write RAMP to ramp rate register with LGPS_CAMCHK o Select Analog_in for ADC input and check with LGPS_CAMCHK o Check Interlock bits with LGPS_CAMSTAT o Turn on Enable with LGPS_CAMOUT o If supply is reversible, turn ON or OFF Polarity bit and check latched polarity and polarity status bit (ON=normal,OFF=reverse) o Check Enable and System ready with LGPS_CAMSTAT o Turn on DC ON bit with LGPS_CAMOUT o Check DC ON, and all other ON bits with LGPS_CAMSTAT 7. If function requested is OFF, o Turn OFF Enable with LGPS_CAMOUT o Check DC ON, Enable bits are OFF, Interlocks still ON with LGPS_CAMSTAT 8. If function requested is Reverse, o Check Hsta_reversible bit is ON o Turn OFF Enable with LGPS_CAMOUT
LARGE POWER SUPPLY CONTROLLER Page 6-11 o Check DC ON, Enable bits are OFF, Interlocks still ON with LGPS_CAMSTAT o Turn ON or OFF Polarity bit (ON=normal,OFF=reverse) o Check latched polarity and status bit with LGPS_CAMSTAT o Turn on Enable with LGPS_CAMOUT o Check Enable and System ready with LGPS_CAMSTAT o Turn on DC ON bit with LGPS_CAMOUT o Check DC ON, and all other ON bits with LGPS_CAMSTAT 9. Set appropriate bits in HSTA and update database Stat_good = LGPS turned on Stat_ok = LGPS reversed Stat_dead = LGPS turned off Stat_sick = LGPSCNTL failure
6.4.5 BULKCNTL Procedure Bulk supplies feeding several LGPS controllers are treated as a single unit for the purposes of ON/OFF control by the panels. When a bulk supply is to be controlled, the routine BULKCNTL is called by MAGDRVR, with a unit number set to the unit identifier of the Bulk supply. At the present time there is only one bulk supply in the system, so the unit number is not being used. The BULKCNTL routine loops over the LGPS units on the bulk supply, turning them ON or OFF in a predetermined order. If an error occurs while turning ON any of the units, an attempt is made to turn OFF all units, thus leaving their DAC's at 0 and the Enable OFF.
LARGE POWER SUPPLY CONTROLLER Page 6-12 Error messages generated indicate which LGPS produced the fault and the error condition, as with LGPSCNTL.
6.4.6 DEGAUSS Subroutine Magnets in critical beam line positions where the residual magnetic field must be minimized after use have been equiped with reversible LGPS controllers so they can be degaussed. To DEGAUSS a magnet, three additional secondaries must be defined: :GSCY: 42,4,2I2; !Number of Degauss cycles, Nwait(msec) for switch :GLIM: 43,4,2R4; !IPOS, INEG currents for Degauss cycle :GTIM: 44,4,2I4; !Last time successfully Degaussed Only a single LGPS can be degaussed at a time. It must have the HSTA_Reversible bit on in HSTA and have non-zero values for GSCY and GLIM. If the magnet has not been calibrated, DVI will be used to calculate the set points. Otherwise, DVIC will be used. Degauss procedure: 1. Check that magnet is ON and correct polarity 2. If not, set correct polarity and turn ON 3. Loop over GSCY(1) cycles, once for each polarity o Calculate DAC setting for Degauss current GLIM(1) or GLIM(2) o Set DAC and check o Wait for ramping o Sleep GSCY(2) milliseconds o Read back ADC, convert to current and check against ATOL o Print error or success message
LARGE POWER SUPPLY CONTROLLER Page 6-13 o Set opposite polarity 4. If successful, print message and put time stamp GTIM in database 5. On any error except tolerances, quit immediately with an error message 6. On a tolerance error, continue but print Failed message 7. In all cases, turn off supply before returning
6.5 MAGNET CONTROL IN THE MICROS
6.5.1 Initialization On IPL, the micro constructs database lists for all LGPSes and magnets. The LGPS lists MUST precede the magnet lists. Series magnets without shunts are not considered by the micro. For each LGPS with shunted magnets, the micro gets the list of magnets on this LGPS from MAGS and constructs a list of pointers to its magnets, where the pointer is the index of each magnet in the database lists. The LGPS pointer, PSCP, of each shunted magnet is also converted to an index pointer. READADC constructs its own internal ADC pointers for each LGPS.
6.5.2 Magnet Control All magnet control in the micro is handled by MAGCNTL.
LARGE POWER SUPPLY CONTROLLER Page 6-14 All special setting of the LGPS or shunted magnets required for calibration or standardization is handled by the function SHUNTSET(TYPE,MODE) where TYPE = parameter to select LGPS or shunts MODE = parameter to select min, max, or previous current The parameters for TYPE and MODE, as well as the call arguments for the individual control routines are found in the include file SHNTCNTL. MAGCNTL procedure: 1. Update all type 2 database lists, ie. HSTA,BACT,CMND 2. Select desired control function according to bits set in GCMD, the cluster global command word. 3. If calibrate, call CALIBALL(SET_LGPS) to calibrate LGPSes call CALIBALL(SET_SHNT) to calibrate magnets 4. If standardize, call STDZALL(SET_ALL) to do all magnets at once 5. If check or trim, call LGPSCHK to get setpoints for shunted LGPSes call MAGTRCK(SET_LGPS) to check and trim LGPSes call MAGTRCK(SET_SHNT) to check and trim magnets 6. Refresh and send back to VAX database all new type 3 data.
6.5.3 Calibration Calibration of the large power supply DAC vs current is done by the individual sector micros using the same algorithm as used for standard magnets.
LARGE POWER SUPPLY CONTROLLER Page 6-15 The series magnets without shunts need no individual calibration. The shunted magnets are calibrated individually using the standard calibration procedure, where the max and min current limits now represent max and min shunt currents. Calibration procedure: 1. Calibrate the LGPS first, if requested. 2. Set the LGPS to IMMO(2) which is the max operating current if any of its individual shunts need calibration, by calling SHUNTSET(SET_LGPS,SET_MAX) 3. Calibrate all magnets including shunted magnets 4. Set the LGPS back to the current INOW that it had before step 2 by a call to SHUNTSET(SET_LGPS,SET_SAV) This guarantees that a request to calibrate an individual shunt will restore the LGPS and its other shunts to their previous status after the calibration is finished.
6.5.4 Standardization Standardization of magnets powered by a large supply is done for all magnets on a supply at the same time. For shunted magnets, it is necessary to set all shunt currents to min before starting standardization. Standardization procedure: 1. If necessary, set all shunt currents to min for all magnets listed in the MAGS list of an LGPS by a call to SHUNTSET(SET_SHNT,SET_MIN)
LARGE POWER SUPPLY CONTROLLER Page 6-16 2. Standardize all magnets and LGPSes 3. Shunts are left at min and set going down.
6.5.5 Check And Trim An LGPS controlling shunted magnets is trimmed to a desired current, IDES, which is calculated by LGPSCHK from the currents required by the individual shunted magnets requesting trim. An LGPS controlling series magnets without shunts is trimmed like any standard magnet. Shunted magnets are checked against their set point using the standard procedure, except that current in the magnet equals current in the LGPS minus measured current in the shunt. Shunted magnets require no special handling for trim. Check and Trim procedure: 1. Calculate the set_points for all shunted LGPS with LGPSCHK 2. Check and trim the LGPS 3. Check and trim all magnets
6.5.6 LGPSCHK LGPSCHK is an integer function which calculates the setpoints, IDES, for the large power supplies which control a set of shunted magnets.
LARGE POWER SUPPLY CONTROLLER Page 6-17 LGPSCHK procedure for each shunted LGPS: 1. Loop over the magnets on that LGPS with the Trim bit on o Calculate the desired current from BDES o Find the maximum current required, CMAX o Find the minimum current required, CMIN 2. If any of the magnets have the Check and/or Trim bit set, then the LGPS will also be checked and/or trimmed. 3. If any of the magnets have the Trim bit on, calculate a new setpoint for the LGPS as follows o CMAX must be less than the maximum operating current of the LGPS o CMAX - CMIN must be less than the maximum shunt current available, SMAX, if both max and min are to be satisfied at the same time o The setpoint is chosen to be 5% above CMAX, but not greater than the maximum operating current of the LGPS o If CMAX - CMIN is too close to SMAX, then the setpoint is chosen to be (CMAX + CMIN + SMAX)/2 to optimize between the max and min requirements