Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Source Controller software status HCAL fall meeting Oct 13-15, 2005 Ianos Schmidt The University of Iowa
  2. 2. System HF+ HE+ HO+1,+2 HB+ HO0 HO –1,-2 HE- HF- Services: Air drivers Electric drivers 0 2 3 3 0 0* 2 3 2 3 0 0* 3 3 0 2 Total 10 16 Crate of controller boards HB- 0 0* Air supply pressure switches RS-485 links DIM Server DIM Client(s) Crate of controller boards Local control laptop RS-232 directly to individual boards. Power supplies 5V,18V,24V Zone safety interlocks * HO will use a temporary portable system New
  3. 3. Software component diagram DIM Server Config. info Tube maps Source code Run Control DIM clients Controller boards DIM clients RS-485 Local disk <ul><li>Config. info </li></ul><ul><li>Tube maps </li></ul><ul><li>Source code </li></ul>Database ? Controller code and settings in flash memory Local tools for configuration, testing, and compiling code Control PC Laptop RS-232 Tools for testing, configuration and programming of controllers.+ Controller source code. DIM client
  4. 4. Air driver controller code <ul><li>Development of the air driver specific functions has started. </li></ul><ul><ul><li>Working representations of all functions exist and operate correctly with the DIM server, but need refinement of fault detection and handling. </li></ul></ul><ul><ul><ul><li>Experience with the electric drivers has shown that robust fault detection is necessary to protect the equipment from damage. </li></ul></ul></ul><ul><li>Next step is merge the air driver specific functions with the core structure of the most recent version for the electric drivers. </li></ul><ul><ul><li>Expect to have Version1 of code ready by end of October. </li></ul></ul>
  5. 5. Electric driver controller code <ul><li>The most recent version of the code is presently in use at SX5 for HE- sourcing. </li></ul><ul><li>Code is very mature, but needs more robust fault detection in init sequence. </li></ul><ul><ul><li>Speed control is the only remaining electric driver specific feature that may still be implemented. </li></ul></ul><ul><ul><ul><li>Speed control code has already been written and appears to work, (ie. control loop is stable), but introduces much more complexity which has yet to be fully evaluated. -This is not a critical item at the moment. </li></ul></ul></ul>
  6. 6. Remaining controller code work common to both driver types <ul><li>Restructuring of status information and fault handling </li></ul><ul><ul><li>Restructuring will likely be necessary after completion of the air driver specific functions to provide a consistent hardware independent interface to the DIM server. </li></ul></ul><ul><li>Reel init button so wire can be retracted when DCS is not functional </li></ul><ul><li>CRC checking of controller code. </li></ul><ul><ul><li>Started investigating ways of getting a CRC code into the programmed device. No easy way to do it. Presently there are three possible solutions: </li></ul></ul><ul><ul><ul><li>1. Custom “plug in” that interfaces with the programming software. </li></ul></ul></ul><ul><ul><ul><li>2. Custom tool that inserts it into the hex file used to program the device. </li></ul></ul></ul><ul><ul><ul><li>3. Implement a way to program the CRC code using the controller code itself, similar to the way configuration parameters are programmed. </li></ul></ul></ul>
  7. 7. Remaining controller code work cont. <ul><li>Geiger counters </li></ul><ul><ul><li>Geiger counter code has not been started but should not be too difficult to implement, but It is not apparent that we need this functionality. </li></ul></ul><ul><ul><ul><li>Geiger counters (provided by Purdue) use transformers. Proper operation is not likely in a strong magnetic field excluding their use in the PSD’s. </li></ul></ul></ul><ul><ul><ul><li>Geiger counter use for TSD’s may be useful but should only be considered as a hardware checking tool, not as a part of the required safety equipment that falls under the responsibility of TIS/Radioprotection. </li></ul></ul></ul><ul><ul><ul><li>Geiger counter signals require some interpretation. </li></ul></ul></ul><ul><li>Testing and more testing… </li></ul><ul><ul><li>there are many possible fault conditions which tend to conspire. It is certain that there are remaining “undesirable features” to be discovered. -Need Feedback from use in the field. </li></ul></ul>
  8. 8. DIM Server SDriver objects. One/controller RSport objects. One per serial port. RSport objects HWconfig object configuration file DIM info and command service objects DIM SDriver object 1 SDriver object 2 SDriver object 3 SDriver object 4 SDriver object n
  9. 9. DIM Server code status <ul><li>The DIM server code has been completely rewritten. The new version (incomplete) is presently in use at SX5 for both HB+ and HE- sourcing. </li></ul><ul><li>New features: </li></ul><ul><ul><ul><li>Allows multiple controllers to share serial ports (RS485 buss) </li></ul></ul></ul><ul><ul><ul><li>DIM server is aware of driver fault conditions </li></ul></ul></ul><ul><ul><ul><li>“ fatal error” bit implemented to inform runcontrol of a fault condition (Causes runcontrol to abort sequence). </li></ul></ul></ul><ul><ul><ul><li>Hardware configuration file implemented to specify driver specific information as well as global parameters. </li></ul></ul></ul>
  10. 10. Remaining DIM server work <ul><li>Implementation of Partition locking </li></ul><ul><li>implementation of map files </li></ul><ul><li>Implementation of the following DIM services: </li></ul><ul><ul><ul><li>Driver name (text string). </li></ul></ul></ul><ul><ul><ul><li>Map file name (text string). </li></ul></ul></ul><ul><ul><ul><li>Name of current index (text string). </li></ul></ul></ul><ul><ul><ul><li>Messages from server (text string). </li></ul></ul></ul><ul><ul><ul><li>Load map file command service (text string). </li></ul></ul></ul><ul><li>Definition of interface with runcontrol </li></ul>
  11. 11. Run control interface <ul><li>The interface to run control needs to be defined. There are two outstanding issues: </li></ul><ul><li>* Two competing ideas as to how to organize the control structure have been proposed. </li></ul><ul><li>1. Have the majority of operator interaction be through run control. </li></ul><ul><ul><li>Requires handshaking with the DIM server to share info. </li></ul></ul><ul><li>2. Have most of the interaction through a PVSS DIM client. </li></ul><ul><ul><li>Requires no additional changes to runcontrol. </li></ul></ul><ul><li>*Run control presently can only communicate with one driver. </li></ul><ul><ul><ul><li>How are drivers to be specified? At the moment driver specific DIM services are specified by the driver number. This number is the address number derived from the controller crate backplane (slot No.) This is not very intuitive and likely to cause mistakes (namely operating the wrong driver!). </li></ul></ul></ul><ul><ul><ul><ul><li>A possible solution is to use driver name, not address. </li></ul></ul></ul></ul>
  12. 12. Other info.:Controller software overview <ul><li>Each controller board contains a Philips 89C51RB2 microcontroller. The code for these is written in the native “8051 compatible” assembly language. </li></ul><ul><li>The Assembly code is complied using ASM51, and the controllers are programmed using either WINISP or Flash Magic programming tools. All of these tools are free, and operate under Windows. </li></ul><ul><li> The programming interface is non-proprietary and fully documented allowing the option to implement a custom programmer on any platform in the future if necessary. </li></ul><ul><li>This code provides all functionality to operate the Purdue wire source drivers, and to provide a standard interface, regardless of driver type, via RS-232 or RS-485 to the DIM server. </li></ul><ul><li>Information that describes the specific hardware and related behaviors is stored in a block of flash memory which is transferred to RAM at boot up. These values can be modified and resaved, or default values can be restored via the serial interface. Generally speaking these parameters will only need to be changed if the driver hardware or control electronics are changed. </li></ul>
  13. 13. Other info.:DIM Service information <ul><li>COMMAND SERVICES </li></ul><ul><li>Command name Format Parameter1 Parameter2 </li></ul><ul><li>1. &quot;CMS/HCAL/RSRC[_ServerSubname]/{DEV}/INIT I:2 Index Reel </li></ul><ul><li>2. &quot;CMS/HCAL/RSRC[_ServerSubname]/{DEV}/GO&quot; I:2 Index Reel </li></ul><ul><li>3. &quot;CMS/HCAL/RSRC[_ServerSubname]/{DEV}/SCAN&quot; I:2 Index_from Index_to </li></ul><ul><li>4. &quot;CMS/HCAL/RSRC[_ServerSubname]/{DEV}/STOP&quot; </li></ul><ul><li>5. &quot;CMS/HCAL/RSRC[_ServerSubname]/DEBUG&quot; I:2 Device(0 means all) level(0-3) </li></ul><ul><li>Information services. </li></ul><ul><li>-------------------- </li></ul><ul><li>1. &quot;CMS/HCAL/RSRC[_ServerSubname]/STATUS&quot; I:16 </li></ul><ul><li>Contains status words (see lower) for all the 16 drivers </li></ul><ul><li>2. &quot;CMS/HCAL/RSRC[_ServerSubname]/{DEV}/STATUS&quot; I </li></ul><ul><li>Service sends the structure SrcInfo: </li></ul><ul><li>typedef struct { </li></ul><ul><li>int message_counter; </li></ul><ul><li>timeval time_stamp_1; //{int seconds; int mkseconds;} </li></ul><ul><li>int status; </li></ul><ul><li>int index_counter; </li></ul><ul><li>int reel_counter; </li></ul><ul><li>int motor_current; </li></ul><ul><li>int speed; // not implemented yet in the driver </li></ul><ul><li>timeval time_stamp_2; (int 0; int 0;} will be filled in the Event Builder </li></ul><ul><li>}SrcInfo; </li></ul><ul><li>* Does not include services for configuration information and tube maps. </li></ul>
  14. 14. Other info.:Server log file <ul><li>The DIM server writes a local log file for each driver which contains an entry for each change in status. For changes in controller status an entry consists of all controller state information. </li></ul>10:03:00 254 160 0000 0010 884 2 0 107 0000 0000 0000 0000 0000 0000 10:03:04 254 160 0000 0011 583 2 48 107 0000 0000 0000 0000 0000 0000 10:03:05 254 160 0000 0010 634 2 56 107 0000 0000 0000 0000 0000 0000 10:03:15 254 160 0000 0000 5 2 0 24 0000 0000 0000 0000 0000 0000 10:04:44 Command SCAN recived with parameters: 7 7 10:04:44 254 160 0000 0110 6 2 5 78 0000 0000 0000 0000 0000 0000 10:04:45 254 160 0000 0000 0 2 0 78 0000 0000 0000 0000 0000 0000 10:04:45 254 160 0000 0010 0 2 0 105 0000 0000 0000 0000 0000 0000 10:04:46 254 160 0000 0000 0 2 0 107 0000 0000 0000 0000 0000 0000 10:04:46 254 160 0000 0101 0 2 37 80 0000 0000 0000 0000 0000 0000 10:04:47 254 160 0000 0000 0 3 0 78 0000 0000 0000 0000 0000 0000 10:04:47 254 160 0000 0101 0 3 47 78 0000 0000 0000 0000 0000 0000 10:04:49 254 160 0000 0000 0 4 0 78 0000 0000 0000 0000 0000 0000 10:04:49 254 160 0000 0101 0 4 53 78 0000 0000 0000 0000 0000 0000 10:04:50 254 160 0000 0000 0 5 0 78 0000 0000 0000 0000 0000 0000 Mon Jul 19 add comm status reel ind I V Errors0 Errors1 Warnings 10:04:50 254 160 0000 0101 0 5 36 78 0000 0000 0000 0000 0000 0000 10:04:51 254 160 0000 0000 0 6 0 78 0000 0000 0000 0000 0000 0000 10:04:52 254 160 0000 0101 0 6 42 78 0000 0000 0000 0000 0000 0000 10:04:53 254 160 0000 0000 0 7 1 78 0000 0000 0000 0000 0000 0000 10:05:03 254 160 0000 0001 3 7 44 105 0000 0000 0000 0000 0000 0000 10:06:18 254 160 0100 0001 6534 7 0 107 0000 0000 0000 0000 0000 0100 Sample from log file:
  15. 15. Other info.:Tube maps <ul><li>Tube maps from files or a database will be used to provide specific information about the tubes that are connected to the drivers. Which map to use can be specified from a DIM client, otherwise the default specified in the configuration data will be used. </li></ul><ul><li>Each entry is associated with the index number from the related driver. </li></ul><ul><li>A tube map contains the following information: </li></ul><ul><li>Global: </li></ul><ul><li>Map title </li></ul><ul><li>Driver type </li></ul><ul><li>First and last tube number </li></ul><ul><li>Optional default settings for the driver (parameter overrides) </li></ul><ul><li>Tube specific: </li></ul><ul><li>Tube number. </li></ul><ul><li>Tube name (ie. “HE+1, sector 2, slice 1, layer 5”) </li></ul><ul><li>Partition number </li></ul><ul><li>Tube status (skip, ok, warn, test) </li></ul><ul><li>Maximum length </li></ul><ul><li>Start of detector/area of interest </li></ul><ul><li>(Optional settings such as motor voltage/speed for extend/retract, in/out of detector) </li></ul>
  16. 16. Other info:DIM clients <ul><li>A Visual source controller client is under development using Borland tools. This provides an easy to use graphical interface that allows use all the available DIM services and commands. Ultimately this will be implemented in PVSS. </li></ul><ul><li>Run control contains a client for merging the source controller data with DAQ data. Run control also provides sequence files to automate the sending of DIM commands. </li></ul><ul><li> The run control DIM interface will have to be updated to use tube map and configuration information. </li></ul>
  17. 17. Other info.:Miscellaneous Other software <ul><li>Controller test program for sending raw serial commands to a controller card. This is to be used while the laptop is directly connected to the RS-232 connector on the front of a controller card. </li></ul><ul><li> When connected in this way the controller is automatically dropped from the RS-485 buss allowing maintenance and testing of individual cards while the other cards are in operation, or for testing cards individually outside of the crate. </li></ul><ul><li>Tool for setting controller parameters and saving them to flash memory. Although this will rarely need to be done it is tedious to do using the raw serial commands. </li></ul><ul><li>DID (Dim display) Tool part of the DIM package for testing DIM servers. </li></ul><ul><li>Borland BCB for building code. </li></ul>