EPICS device support is based on the StreamDevice module [5]. This is a natural solution as its main purpose is its write and read ASCII commands over serial interfaces. To achieve this, an EPICS database with a logic and protocol file had to be written.
Imaging
Laser size, shape and position are monitored with Allied vision GigE cameras [6]. Multiple cameras at appropriate locations are used. The acquired images are processed to extract a variety of desired image parameters.
Implementation is based on the areaDetector [7] module which provides imaging support to the EPICS framework. The architecture is based on drivers, which talk to the hardware (cameras) and plugins. The plugins perform various operations on the acquired images. Images inside the module are represented as objects and are passed from one plugin (driver) to another as pointers, with all required attributes. This implementation is an efficient way to share the data between the plugins. The chain of plugins for Perla C is shown in Figure 4. Most of the plugins used are standard and only need to be configured. Some plugins needed additional functionality and were either developed from scratch or community versions of the plugins were upgraded. This includes: Image Decimator, Background Subtraction and Extended Statistics.
With the ADProsilica driver, the images are acquired from the detectors (cameras). For testing purposes (if a camera is not available), a static image can be loaded from a TIFF file.
The raw camera image can be seen on the HMI for initial inspection. A decimator is used to lower the frame rate, for lower network traffic. The images are forwarded to the PVA plugin which exposes the images on the network via the PV Access protocol. On the second (horizontal) branch, the image is forwarded to other plugins.
On the IOC, the first step for images is background subtraction. The plugin subtracts the selected image from the acquired images. The subtraction removes the background so that only the laser beam or changes to the laser beam are visible.
When the unwanted background is removed, the image is clipped to only display a region of interest. This is done with the ROI plugin from the community. If necessary, the ROI can be by-passed, if the user is interested in the whole area.
Additionally, statistics like centroid, intensity, FWHM and D4σ parameters can be calculated on the clipped image. Not all calculations are supported by the standard community statistics plugin, so it was extended.
For the last step images take three paths. Firstly, the images are displayed on the HMI. The display also includes an overlay which shows the center of the beam and beam size. Secondly, upon request the processed images can be saved on a local hard drive as TIFF files. Finally, the images are stored into a forensic buffer. The forensic buffer is a buffer containing the last configurable value of images.
The images get written to the disk, in case of failure, for further inspection.
Organizational Aspect
The collaboration between Cosylab and HiLASE is continuously improving. HiLASE drafts initial requirements. These are iterated with Cosylab. The HiLASE control system stakeholder and the Cosylab technical lead for development perform reviews. This allows for direct communication and ensures no information is lost. Requirements are finally approved by HiLASE. Part of the requirement document is forward looking and proposes how certain features will be tested. This gives a different perspective to certain requirements, and helps to clarify a definition.
During the design and development, any considerations, issues or ambiguity is addressed and resolved immediately. This keeps the development process smooth and expectations are aligned. A test plan is created by Cosylab and iterated with HiLASE. We learned it is important to include a user perspective into testing the software as the end users understand and use the application differently.
We use a two-stage acceptance process. The development within a “Work Package” is first tested at Cosylab using exactly the same hardware as the HiLASE target hardware. Any fixes and improvements are simplified with this methodology. Through an on-site visit, Cosylab experts and HiLASE execute test plan for final acceptance.

Figure 4: Image processing chain.
Leave a Reply
Want to join the discussion?Feel free to contribute!