Transcript
Page 1: EPICS, MATLAB, GigE CCD Camera Based Beam Imaging System ... · EPICS, MATLAB, GigE CCD CAMERA BASED BEAM IMAGING SYSTEM FOR THE IAC-RADIABEAM THz PROJECT Chris Eckman , Y. Kim, A

EPICS, MATLAB, GigE CCD CAMERA BASED BEAM IMAGINGSYSTEM FOR THE IAC-RADIABEAM THz PROJECT

Chris Eckman∗, Y. Kim, A. Andrews, P. Buaphad, and T. DownerIdaho State University, Pocatello, ID 83201, USA

AbstractAt the Idaho Accelerator Center (IAC) of Idaho State

University, we have been operating an L-band RF linearaccelerator running at low energies (5 - 44 MeV) for theIAC-RadiaBeam THz project [1]. We have designed andimplemented an image acquisition and analysis system thatcan be used for real time observation of the electron beam,tuning of THz radiation production, and measurement ofthe transverse beam emittance. The imaging system con-tains an Yttrium Aluminium Garnet (YAG) screen on anactuator, a Prosilica GC1290 GigE CCD camera with anadjustable lens, a screen illuminator, an optical alignmentstructure, and a lead tube for the camera shielding. The realtime continuous beam images can be acquired by Sample-Viewer, while the single shot beam image can be acquiredby the Experiential Physics and Industrial Control System(EPICS) and areaDetector. In this paper, we describe com-ponents of the imaging system, the real time beam imageacquisition with SampleViewer, the single shot beam im-age acquisition with areaDetector, and a remote control-lable beam image acquisition via MATLAB Channel Ac-cess (MCA), MATLAB, and EPICS.

INTRODUCTIONFor the IAC-RadiaBeam THz experiments, due to the

1.2 mm wide opening gap of the THz radiator, good beamshape control is required at the THz radiator to get goodbeam transmission. To optimize the beam shape freely, tomeasure beam size, and transverse beam emittance, ISUAdvanced Accelerator and Ultrafast beam Lab (AAUL)group has developed an advanced beam imaging system,which can supply the continuous beam image acquisi-tion in real time by using SampleViewer program as wellas the single shot beam imaging acquisition with remotecontrolling function by using areaDetector, EPICS, MCA,and MATLAB. The imaging system consists of a Prosil-ica GC1290 GigE CCD camera, a lens to focus the camera,Thorlabs cage that holds the camera in place, and two Thor-labs supporters to mount the cage on an optical table [2].

THE IMAGING SYSTEMThe full imaging system can be seen in Fig. 1. All of

the components of the optics cage were purchased throughThorlabs and are compatible with each other, thus the op-tics cage was easily assembled. The main Thorlab compo-nents are listed in Table 1. The camera is situated to look

[email protected]

into the crystal window to the YAG screen. The camerauses Gigabit Ethernet to output data onto a local area net-work where it is used by a Linux operating system runningEPICS. This is where the data can be captured, processed,and controlled.

Figure 1: This is the imaging system set-up at the IAC.

Stray light adds to background noise of the image, so ablack covering is placed around the optics cage to preventany unwanted light from entering. In addition, to protectthe camera sensor from damaging radiation, a lead tube isplaced inside the cage to surround the camera. For extraprotection, the optics cage is almost completely surroundedby lead blocks when ready to use. There is an adjustableLED light on the end of the optics cage that is used to illu-minate the YAG screen for alignment and calibration. Theoverall construction, testing and cost makes this set-up at-tractive for an effective imaging system.

PROSILICA CAMERAThe GigE CCD cameras are essential in beam diagnos-

tics where high quality beam images are used for measur-ing various parameters and diagnosing beam quality. Thisparticular camera was chosen because it has a good reso-lution and pixel size (see Table 2). The parameters of the

MOPWA077 Proceedings of IPAC2013, Shanghai, China

ISBN 978-3-95450-122-9

858Cop

yrig

htc ○

2013

byJA

CoW

—cc

Cre

ativ

eC

omm

onsA

ttri

butio

n3.

0(C

C-B

Y-3.

0)

06 Instrumentation, Controls, Feedback and Operational Aspects

T03 Beam Diagnostics and Instrumentation

Page 2: EPICS, MATLAB, GigE CCD Camera Based Beam Imaging System ... · EPICS, MATLAB, GigE CCD CAMERA BASED BEAM IMAGING SYSTEM FOR THE IAC-RADIABEAM THz PROJECT Chris Eckman , Y. Kim, A

Table 1: Main Components Purchased Through Thorlabsfor the Imaging Cage Set-up

Image Description Part Number QTY

Threaded Cage Plate LCP01T 4

Cage Assembly Rod ER18 4

Steel Optical Post TR4 2

Post Holder PH4 2

Mounting Base BA2T2 2

beam calculation rely heavily on the image quality, resolu-tion, distance from object being viewed, electronic noise orbroken pixels, and image exposer.

Table 2: Main Specifications on the Prosilica GigE CCDCamera and the Fujinon HF50SA-1 Lens

Parameter Value or TypeInterface GigEResolution 1280 x 960Sensor size Type 1/3Cell Size 3.75 µmMax frame rate at full resolution 32 fpsLens Focal Length 50 mmLens Minimum Field of View 38 mm x 28 mm

For optimum viewing and imaging, a Fujinon HF50SA-1 lens is directly attached to the CCD camera on a C mountand focused onto the YAG screen (see camera and lensin bottom right of Fig. 2). Using the Fujinon lens makesfocusing, cleaning and adjustment of the equipment quickand easy. The Prosilica camera has an external trigger in-put port that can be used to receive a trigger signal fromthe timing system. The power cable for the camera had tobe physically modified to add this triggering port. Trigger-ing the camera allows it to be synchronized to the beam soproper images can be taken.

SAMPLEVIEWER

Sampleviewer is the GigE CCD camera software fromthe Prosilica company and is provided for free. This pro-gram provides a user friendly tool that works over an in-ternet connection to test a CCD camera quickly, check im-age quality, camera alignment, camera triggering, imagegain, image exposure time, and for real time imaging (seeFig. 2). In order to put the CCD camera on the network, thecomputer’s Ethernet adapter needs to be configured to im-prove the system performance when using the GigE CCD

camera [3]. These changes include the packet size (MTUof 8228), interrupt moderate rate, transmit buffers, and re-ceive buffers. The camera also uses a companion programto SampleViewer, named IPConfig, to change the IP ad-dress of the camera to a static address.

Figure 2: This is SampleViewer and the Prosilica GC1290GigE CCD camera with the attached lens.

EPICS AND AREADETECTOR

To more precisely control these CCD cameras and useimages for data extraction, we need a precise and pro-grammable method that can be accessed by the accelera-tor control Graphic User Interface (GUI). EPICS providesa platform that will allow camera control in an accelera-tor system [4]. EPICS provides GUI for user interactionwhen needed, such as the main areaDetector GUI that isshown in Fig. 3. Each button and input box on this GUIscreen has an associated Process Variable (PV). Images aretaken by the CCD camera using areaDetector’s ”Start” but-ton, where the PV associated with that button is named”13PS1:cam1:Acquire”. All PV’s in areaDetector can becontrolled in MATLAB through MCA.

MATLAB CHANNEL ACCESS

MCA will allow a pathway from MATLAB to theEPICS PVs, this link allows talk between the two differentprograms [5]. PVs are a named piece of data associatedwith the machine, things like status, readback and physicalparameters. With MCA, we are able to send any informa-tion (in the form of PVs) between EPICS and MATLABby means of the channel access, and the accelerator canbe controlled with MATLAB codes directly. MCA is oneof the extensions of EPICS that can be downloaded andinstalled in both EPICS and MATLAB. When it is in-stalled properly, commands can be entered into MATLABand executed to control equipment in EPICS. The maincommands of MCA to open the desired channels between

Proceedings of IPAC2013, Shanghai, China MOPWA077

06 Instrumentation, Controls, Feedback and Operational Aspects

T03 Beam Diagnostics and Instrumentation

ISBN 978-3-95450-122-9

859 Cop

yrig

htc ○

2013

byJA

CoW

—cc

Cre

ativ

eC

omm

onsA

ttri

butio

n3.

0(C

C-B

Y-3.

0)

Page 3: EPICS, MATLAB, GigE CCD Camera Based Beam Imaging System ... · EPICS, MATLAB, GigE CCD CAMERA BASED BEAM IMAGING SYSTEM FOR THE IAC-RADIABEAM THz PROJECT Chris Eckman , Y. Kim, A

Figure 3: This is the main GUI screen of AreaDetector inEPICS.

the equipment and MATLAB, to read information, and towrite to PVs are MCAOPEN, MCAGET, and MCAPUT.An example of the MCA and MATLAB code is following:

CameraAcquire=MCAOPEN(’13PS1:cam1:Acquire’);AcquireData=MCAGET(CameraAcquire);MCAPUT(CameraAcquire,1);MCACLOSE(CameraAcquire);

The MCAOPEN will open the channel to the PVs.The MCAGET will retrieve the status on the PV asso-ciated with the camera shutter. If the CameraAcquireis 0, then the camera shutter is closed. However if theCameraAcquire is 1, then the shutter is open, and thecamera starts taking images. The MCAPUT will writevalues into the PV, such as 1 or 0, and the MCACLOSEwill close the channel of the PVs. These images arethen transferred to the hard drive using MCA to be savedin the designated file path (this path is also a PV andcan be changed). These MCA commands are used inMATLAB to control all aspects of the camera as well asother equipment such as power supplies [4]. Once theimages are in MATLAB they can be processed to removebackground, plot projections, filter the image, and extractdata for parameter measurement. In Fig. 4, the left imageis the same one as in Fig. 2, however the background issubtracted and is color enhanced. The image to the rightis used by an automatic emittance measurement systemrunning in MATLAB and shows the x and y projections onthe image directly [6].

Figure 4: This is MATLAB processed beam images.

SUMMARYEPICS, areaDetector and MCA are successfully installed

and working. The single shot beam images were taken bythe Prosilica GigE CCD camera using MATLAB code inconjunction with areaDetector. By using MATLAB andMCA, the user has access to higher level programming,which can be used to control any accelerator parameterwith PV. For example, the beam images can be transferredfrom the camera to MATLAB code directly, and can beused for computation and plotting with MATLAB. This isan extremely useful tool that can be used in many accel-erator applications and measurements. By using the realtime video capabilities of SampleViewer, the beam imag-ing system was used to optimize the THz radiation at theIAC [7, 8].

ACKNOWLEDGEMENTSWe would also like to give our sincere thanks to Dr.

Mark Rivers of APS for his advice and guidance on AreaD-etector and MCA. In addition, we would like to thank Dr.Henrik Loos of SLAC for his strong interest, advice andencouragement in this project.

REFERENCES[1] http://www.iac.isu.edu

[2] http://www.thorlabs.us/index.cfm?

[3] http://www.alliedvisiontec.com/us/products/cameras/gigabit-ethernet/prosilica-gc/gc1290.html

[4] A. Andrews et al.., in these proceedings.

[5] A. Terebilo et al.., in Proc. ICALEPCS 2001, THAP030, SanJose, CA, USA.

[6] C. Eckman et al.., in Proc. IPAC2012, TUPPC055,New Or-leans,LA

[7] Y. Kim et al.., in these proceedings.

[8] A. V. Smirnov et al.., in these proceedings.

MOPWA077 Proceedings of IPAC2013, Shanghai, China

ISBN 978-3-95450-122-9

860Cop

yrig

htc ○

2013

byJA

CoW

—cc

Cre

ativ

eC

omm

onsA

ttri

butio

n3.

0(C

C-B

Y-3.

0)

06 Instrumentation, Controls, Feedback and Operational Aspects

T03 Beam Diagnostics and Instrumentation