EPICS routine for conditioning ED1, ED2 high voltage ---------------------------------------------------- High voltage on the DRAGON electrostatic dipoles may be raised gradually using an EPICS routine which monitors the anode and cathode currents, the tank pressure and the x-ray rate. This allows for slow conditioning of the ED's under computer control. An EPICS page, called from the Optics|Condition ED1 option of the DRAGON menu bar, allows the initialization, launching, monitoring or stopping of HV conditioning. Each of the 4 monitored parameters (anode current, cathode current, pressure, x-rays) must be within a range specified by 2 numbers ("Too Low" and "Low") before a voltage increase will take place. An upward step in voltage (by "Upstep" kV) will be considered by the control loop once every "Uptime" seconds. The need to step voltage back down because of heavy conditioning is considered once every "Downtime" seconds. The HV setpoint will be reduced by "Downstep" kV if any of the 4 parameters lies in the range between "High" and "Too High". If any parameter lies between "Low" and "High", it is neither a cause for a down-step nor license for an up-step in HV. The control loop should sit at the same voltage setpoint until another Uptime or Downtime seconds have elapsed. If any parameter is found to be higher than "Too High" the routine exits from the control loop, on the assumption that something has gone wrong with a readback or some other unexpected hardware failure has happended. Similarly, going below "Too Low" terminates the loop. Conditioning terminates also if the user clicks the Stop button on the conditioning page, or if some other agent (user or Scaling routine) changes the Setpoint value from the value last set by the HV Conditioner. To set up HV Conditioner: - manually determine the HV Setpoint at which signs of conditioning appear and enter this number as VSTART (in kV). - choose the voltage at which conditioning should end as VSTOP (in kV). - choose the step size for voltage increases (in kV). Suggested: 0.01 - choose the minimum interval between steps up (in seconds). Suggested: 60 - choose step size and interval for voltage decreases. Suggested: 0.05 kV and 30 sec - specify the effective resistance of the HV stack (MOhms = V/uA). We are interested in the net current after stack current is subtracted, using this constant. Suggested: 6000 - specify the TooLow, Low, High, TooHigh limits of anode current and cathode current (uAmps). Suggested: -10, 5, 20, 50 - specify the limits on pressure (in Torr). Suggested: 0.7E-9, 5.0E-7, 3.0E-6, 3.0E-5 - specify the x-ray rates. Suggested: 2, 500, 5000, 300000 Start the conditioning by clicking on "Condition DRA:ED1" (or :ED2). A watchdog timer should start counting up from 0 and keep counting as long as the control loop has not been terminated. The read-back voltages and currents as well as the Setpoint voltage are displayed in each of the Anode and Cathode boxes. In each of the 4 boxes a green triangle will point up if everything is OK to step up the HV, or will point down if the HV should be stepped down. If the control loop is terminated because of one parameter staying out-of-range, a red "stop sign" is displayed for that parameter. The value which caused abnormal termination should appear in the last part of the log file, which can be displayed by clicking on "View log". Dave Hutcheon 26 Feb 2003