Proceedings of IBIC2012, Tsukuba, Japan

MOPA33IMAGE PROFILE DIAGNOSTICS SOLUTION FOR THE TAIWANPHOTON SOURCE
C. Y. Liao#, C. H. Kuo, C. Y. Wu, Y. S. Cheng, Demi Lee, P. C. Chiu, K. H. Hu, K. T. Hsu
NSRRC, Hsinchu 30076, Taiwan
TPS (Taiwan Photo Source) is a third generation 3 GeV
synchrotron light facility, featuring ultra-high photon
brightness with extremely low emittance which will be astate-of-the-art synchrotron radiation facility and is being
in construction at National Synchrotron Radiation
Research Center (NSRRC) campus. Beam image profile
and its analysis play an important role in beamdiagnostics of a particle accelerator system. However, due
to the CCD image collection devices are distributed
around the linac, booster, and storage ring, a distributed
EPICS system based image profile diagnostics solution
was proposed, which are based on GigE Vision camera
with PoE support. This solution provides an easy way forcabling,anddeliveryadequate
performance.
Implementation plan for the TPS and results of prototype
test at existed facility to examine functionality of
hardware and software will be summarized in this report.

INTRODUCTION
The TPS is a state-of-the-art synchrotron radiation
facility featuring ultra-high photon brightness withextremely low emittance [1]. Civil construction wasstarted from February 2010. The building will be finishedin 2012. Machine commissioning is scheduled in late2013. User service will start from 2014. The TPS
accelerator complex consists of a 150 MeV S-band linac,
linac to booster transfer line (LTB), 0.15–3 GeV booster
synchrotron, booster to storage ring transfer line (BTS),
and 3 GeV storage ring. The storage ring has 24 DBA
lattices cells with 6-fold symmetry configuration. The
latest generation diagnostic systems will equip to help
TPS achieve its design goals.
To optimize the machine operation and diagnostic
applications, the beam profile and its analysis play animportant role in the beam diagnostics of a particleaccelerator system. The use of a destructive (fluorescentscreen, YAG:Ce, Y3Al5O12 [2]) or non-destructive(Microchannel plate, MCP [3]) screen monitor, or asynchrotron radiation monitor [4] to measure the beamprofile is a simple mechanism that has been widely usedin synchrotron facilities. The beam-profile image conveys
extensive information about beam parameters, including
the beam centre, sigma, tilt angle etc. As is customary, thebeam profile as a two-dimensional (2D) image is recordedwith cameras. The fluorescent screens that convert theflux density of the beam into a measurable signal as afunction of position, and a charge-coupled device (CCD)
camera for image acquisition, are used in applications of

this kind. Thanks to inexpensive CCD cameras and theavailability of computer technology, the obtaining,storage and analysis of 2D images has become easier andquicker. The images of the beam as recorded withcameras are most conveniently represented as lightintensity with 2D circular or elliptical Gaussian
distributions.
In this report, a distributed EPICS system based image
profile diagnostics solution was proposed, which are
based on Gigabit PoE (Power over Ethernet) embedded
vision system with PoE camera. This solution provides aneffective way to simplify wiring, and increased
performance, load independence and reliability, which
can be used at various places such as screen monitor,
synchrotron radiation monitor, ICCD, and streak camera,
as a standalone image acquisition and processing system.

OVERVIEW OF INFRASTRUCTURE
The infrastructure is developed by using a Gigabit PoE
embedded vision system installed the EPICS IOC andintegrated with Matlab program to build up a dataacquisition and processing system. For the beamdiagnostic application, this system is responsible for the
beam profile acquisition from fluorescent screen, gated
ICCD or streak camera, and used to analysis to find thebeam characteristic data. The infrastructure employed canbe divided into hardware and software components as
described in the following subsections.

Vision System and Camera
In the image profile diagnostics solution, a Gigabit PoE
embedded vision system (ADLINK, EOS-1200 [5]), as
shown in Fig. 1, was used instead of traditional computerand switch. This device is a rugged and compact
embedded vision system equipped with the 2nd generation
CPU (i7) and four independent PoE ports. It also supports
a rich I/O capability, including four serial ports(RS232/422/485), two USB 3.0 ports, 32 PNP/NPN
isolated digital I/Os, which make it ideal to integrate, anddeploy with other subsystem for system development.

Figure 1: Gigabit PoE embedded vision system.

___________________________________________#liao.cy@nsrrc.org.tw

ISBN 978-3-95450-119-9
Data Acquisition Techniques1

c 2012 by the respective authors — cc Creative Commons Attribution 3.0 (CC BY 3.0)
Copyright ○AbstractMOPA33

Proceedings of IBIC2012, Tsukuba, Japan

Two type of GigE Vision PoE cameras are available
which consist of square pixel size of 7.4 μm × 7.4 μm and3.75 μm × 3.75 μm for low-precision measurement ofscreen monitor at linac, LTB, BTS, booster, and highprecision measurement of synchrotron radiation monitor
at storage ring. The cameras have software and external
trigger input port which can be used to capture image bysoftware control or receive trigger signal from event
based timing system [6] for periodic data acquisition. Due
to we are interested in the intensity of the beam profile,the monochromatic mode of this camera was used in thisapplication. The GigE Vision camera is connected with
Gigabit PoE embedded vision PC by Ethernet interface tobuild up local area network. The CCD power can becontrolled via the PoE manager function for device
resetting.

c 2012 by the respective authors — cc Creative Commons Attribution 3.0 (CC BY 3.0)
Copyright ○Software
The Gigabit PoE embedded vision system, running aLinux operating system based on EPICS, is designed as
an IOC (Input / Output Controller) for data capture,
analysis, and other devices control. For one of theapplications (screen monitor), the block diagram ofsoftware (IOC, Matlab, and GUI) and hardware
configuration is shown in Fig. 2. There are three EPICS
IOCs build-in which responsible for CCD image capture
and parameter control, analysis results storage, andmotion stage control, respectively. One analysis program
constructed by Matlab running on host can get raw image
array from IOC1 and analysis the key parameters (sigma,
center position, tilt) then write into IOC2. All thevariables are the EPICS PVs which can remote set/get
whole parameters via channel access (CA). A graphicaluser interface was developed to control/monitor thesystem.

IOC and display them in the window. The GUI contains
six parts: menu, toolbar, control panel, fitting results,
projected profile, and raw image. The menu and toolbar
provide save data, colormap change, ROI specify,
simulation, reset and close program, and zoom in/out
functions. In the control panel it contains active theprogram, 3D viewing, multi-exposure, and backgroundsubtract functions. The fitting results area contains sigma
and centroid data in the units of pixel and mm, and beamtilt angle. Two directions, horizontal and vertical, of beam
projected profile of raw data and fitting curve are
predrilled in two axes. The camera raw image with thecolorbar is integrated into the display GUI. The functionof export the raw image data and analysis results can be
done. It also can create a simulated beam image for the
purpose of evaluating the fitting correctness. In this study,
the compiled Matlab programs help us to develop
standalone application without running it in Matlab
prompt which is to minimize the requirement of licenceand save budget.
Menu: Save, Colormap, ROI, Simulation, Reset, Close
Toolbar: Zoom in/out
Control Panel
Fitting Results

Capture Date
Hor. Projected Profile
Gree: Raw, Blue: Fit
Enable/Disable Fitting
Threshold

Camera ID
Raw ImageVer. Projected Profile
Gree: Raw, Blue: Fit

Fitting Parameters
RMSE, Offset, Slope, Max
Colorbar

Fitting Elapsed Time

Figure 3: Layout of the Matlab display GUI.

Analysis Methods
TLS
Control System

MatlabGraphical User Interface(Delay Time Control, CCD Parameters Control,
Analysis Results Access)

Advance Control (Password)

MatlabAnalysis Program

IOC1
areaDetector

CCD
Stage

IOC2
Parameters & Results(ROI, M-factor, Sigma(i),Image(i), …)Data Acquisition & Analysis Platform

Controller

IOC3
Motion Control

Figure 2: The block diagram of software and hardware
configuration.

Users Interface
The user interfaces are constructed by Matlab GUI. The
layout of the Matlab display GUI for screen monitor isshown in Fig. 3. Through the Channel Access (CA,LabCA) [7], the Matlab program can read/write thedatabase records. The GUI can run in multiple clientssimultaneously and read the analysis results from EPICS

For the analysis of projected 2D circular or elliptical
Gaussian distribution beam profiles. This Gaussian curve
fit by least-squares minimize, called “lsqcurvefit” method
is one of the optimization toolbox in Matlab which cansolve nonlinear curve-fitting problems in the least-squares
sense that minimized the sum of squared differences
between the measured and predicted data. “lsqcurvefit” isan iterative method which returns results that minimizes
the residuals when the tolerances supplied are satisfied.
That is, given input data xdata, and the observed output
ydata, find coefficients x that “best-fit” the equation
F(x,xdata):
min
x

2
1
  F  x, xdatai   ydatai 
2 i

(1)

, where xdata and ydata are vectors and F(x,xdata) is avector valued function. This method can be used to deal
with high signal-to-noise levels image, but it takes a longcomputing time due to it is an iterative algorithm.
Fortunately, the maximum number of function
evaluations (MaxFunEvals, default 500) and iterations

ISBN 978-3-95450-119-9
2

Data Acquisition Techniques

Proceedings of IBIC2012, Tsukuba, Japan(MaxIter, default 400) allowed, and termination tolerance(TolX, default 1e-6) can be configured to satisfy
operational requirements. The algorithm was developed
and tested in Matlab environment. The beam profile
images model can be built by a general two-dimensional
elliptical Gaussian function, as expressed byf  x, y   Ae

 a ( x  x0 ) 2  2 b ( x  x0 )( y  y0 )  c ( y  y0 ) 2



TPS Control Network

EPICS IOC (Linux)
Access by:
areaDetector Module (EPICS)
Matlab, here the coefficient A is the amplitude, x0, y0 are thecenter of x, y and a, b, c are defined as following:

ADLINK EOS-1200
Powerful 4-CH Gigabit
PoE Embedded Vision
System with 2ndGeneration Intel®
Core™ i5/i7 Processor

To another IOCs
for screen
monitor actuator
control

10 Ports POE Switch
D-Link DGS-1210-10P

Timing(CIA Timing IOC)(2)

MOPA33

CIA #12CIA #24
24 Ports POE Switch
D-Link DGS-1224TP
Linac x 5
LTB x 7
BTS x 5BR x 3SR x 1

PV example:
Current_Active_SM_xx
TL-DI-SM:Actuator_ON……………………
BR-DI-SM1:Actuator_ON…….......................
SR-DI-SM1:Actuator_ON_LS……………………

Allied Vision Technologies
Manta-032 (CCD, 656x492,
7.4 um square pixel)

Insertable YAG:Ce fluorescence screen and OTR

cos 2  sin 2 a
2 s x22 s 2ysin 2 sin 2

4sx2
4s 2y

(3)

sin 2  cos 2 c
2 s x22 s 2y, where theta (θ) is the rotate angle and sx, sy are the sigma
of x and y.

Timing Evaluation of Analysis Program
A timing evaluation of the analysis program was made.
Two key processes can affect the time required for each
image frame processing procedure: reading/writing datafrom PV via EPICS channel access, and fitting the
projected profiles. The reading or writing of data from
PVs, including some conditions and raw image data array,takes less than 20 ms with camera exposure time. The
data processing, including twice fitting (horizontal andvertical) and recognition of the tilt angle, takes less than
50 ms. The program thus requires less than 70 ms per
cycle, which implies a maximum rate around 14 Hz ofprocessing. This performance is adequate for the TPS 3Hz and TLS (Taiwan Light Source) 10-Hz facilities.

IMAGE DIGNISTIOCS PLANS
Screen Monitor
There are 21 screen monitors are designed in the TPS
located at linac (5), LTB (5), booster ring (6), and BTS(5). Fluorescent screens will be installed at injection andextraction section and at the other lattice cells to facilitate
booster commissioning, troubleshooting and psychology
needing – to see is to believe. The screen material will be
YAG:Ce, which has excellent resolution of the beam
image and exhibits high sensitivity and high radiation
hardness. The linac, LTB, booster and BTS areconfigured almost identically with same cameras and theinfrastructure is shown in Fig. 4. The 10/24 ports PoE
switches are used to connect the cameras then uplink tothe vision system EPICS IOC. The IOC is constructedbased on Linux OS with areaDetector EPICS module [8]and compiled Matlab analysis program. The camera
timing trigger clock is locked with TPS injection system,
which is produced from a timing IOC via copper cable.

Synchrotron Radiation Monitor
Synchrotron radiation from a dipole will be used toobserve the beam profile at TPS. The synchrotron
radiation monitors are designed in LTB, BTS, booster,and storage ring. In the LTB and BTS, a simple visible
light optics at bending magnet captured by external
trigger GigE Vision CCD camera is planned for usefulroutine operation. In the booster synchrotron, near UV
optics and synchronized with the machine cycle isplanned. The photon diagnostics for the TPS storage ring
will utilize visible light and X-ray of the synchrotron
radiation generated in a bending magnet. In the storage
ring, due to the small beam size and emittance (~1 nmrad), an X-ray pinhole camera with crystal screen and
GigE Vision CCD camera is planned, and possible for the
feedback signal for beam size feedback. Two X-ray
pinhole cameras imaging of the electron beam frombending magnets is the baseline design for the TPS
emittance measurement. As they offer the required
resolution and the dynamic range to measure the electron
beam size accurately at all stored beam currents frombelow 1 mA to 500 mA range. Optimization of the X-ray
pinhole system will give possibility to measure very small
beam sizes in a few microns typically. Its main function
will include measurement of the electron beam energy
spread and vertical beam size. A near UV light profile
measurement for low light application and visible lightsynchrotron light interferometer for precision beam size
measurement are also planned in TPS storage ring.

Streak Camera and Gated ICCD
Synchrotron radiation from a dipole has the capability
to monitor bunch length with a streak camera and beam
dynamic profile with a gated ICCD, which will be also
provided in TPS. Visible light beamline station will bebuilt to measure various beam parameters by streak
camera, ICCD camera and interferometer. Streak camera
operates at 250 MHz synchroscan mode is preferred toobserve beam behavior of the consecutive bunches.
Integrating the streak camera and ICCD system withEPICS IOC on Gigabit PoE embedded vision system are
preferred. Due to these two kinds of diagnostics devices
need timing trigger signal for doing correct actuation.
Another cPCI timing platform is needed. The event

ISBN 978-3-95450-119-9
Data Acquisition Techniques3

c 2012 by the respective authors — cc Creative Commons Attribution 3.0 (CC BY 3.0)
Copyright ○b

Figure 4: TPS screen monitor configuration plan.

MOPA33

Proceedings of IBIC2012, Tsukuba, Japan

receiver (EVR) card plugged in cPCI platform which canprovide the precisely timing trigger signal received from
EVG (event generator system, it is available in TPS) for
streak camera and ICCD applications.

PROTOTYPE TEST
Prototype of the proposed system was development andpre-test in TPS linac screen monitor and TLS booster
synchrotron. The results will be presented in following
subsections.

TPS Linear Accelerator
The TPS 150 MeV linac system was contracted to the
RI Research Instruments GmbH (former ACCEL
Instruments GmbH) [9]. The hardware of beam
instrumentation comprises five YAG:Ce screen monitors
were provided by the vendor and each screen is mounted
at 45° to the beam direction and driven with a pneumatic
driver. The fluorescent light is emitted in the horizontal
direction. The optics consist a refraction mirror to bend
the light 90° to the 75-mm lens and a GigE Vision CCD
camera. The five screen monitor beam profiles are shownin Fig. 5.

c 2012 by the respective authors — cc Creative Commons Attribution 3.0 (CC BY 3.0)
Copyright ○

SM1

SM2

SM3

100

100

100

150

150

150

200

200

200

250

250

250

300

300

350
200

300

400

500

350
200

SM4
100

150

150

200

200

250

250

400

500

350
200

300

400

500

(b)
Figure 6: TLS booster synchrotron radiation monitor userinterface. (a) Fixed energy mode; (b) Scan energy mode.

300

300
350
200

300
300

SM5

100

(a)

300

400

500

350
200

300

400

500

Figure 5: Beam profiles of the TPS linac screen monitor.

TLS Booster Synchrotron
For the TLS booster synchrotron, the layout of thesynchrotron radiation monitor consists of molybdenum
mirror, vacuum window, lens, band-pass filter (BPF, 550
nm, spectral width 10 nm), a GigE Vision CCD camera, a
two axes motion stage and an EPICS IOC. The photons ofsynchrotron radiation emitted by the electron bunches
passing through a dipole in the booster ring are reflectedfrom a molybdenum mirror and passed through a convex
lens (f = 500 mm) onto a CCD image sensor. The simple
optics offers image reduction 2:1. The user interfaces areshown in Fig. 6. The fixed energy mode, as shown in Fig.
6(a), the beam profile was recorded right at the CCD
exposure time and trigger delay set to 1 msec and 30 msec
(corresponding to the energy is around 0.8 GeV). The
scan energy mode, as shown in Fig. 6(b), canautomatically adjust the trigger delay and record the data
sequentially. Raw image and fitted parameters are
published as EPICS PVs, it can access by applicationclients for further usage.

The synchrotron radiation monitor of the booster
synchrotron can serve to diagnose the ramping process ofthe booster. In the TLS booster, the electrons areproduced from an electron gun and accelerated to 50 MeV
with a linear accelerator. Before the beam is extracted tothe storage ring, the energy of the electron beam in the
booster is increased from 50 MeV to 1.5 GeV within a
50-ms ramping process. The beam size decreases whenthe energy increases. The CCD trigger timing must be
adjustable within the ramping cycle. The duration of CCD
exposure should be as small as possible. The beam size
during the ramping process is a function of time.
The summarized beam profiles and key parameters
during acceleration in TLS booster are shown in Fig. 7,
and the measured beam size variation, beam center
position and beam tile angle were listed inside. The
measured variation of beam size and position of the beam
center with energy ramping point are shown in Fig. 8 andFig. 9. It is clearly shown that the beam size will become
smaller when energy increased. There is a significant
position shift in horizontal at the ramping time around 45
msec due to the bumper fired. The tile angle of the beamprofile is almost the same during whole ramping process.

ISBN 978-3-95450-119-9
4

Data Acquisition Techniques

Proceedings of IBIC2012, Tsukuba, Japan

Figure 7: TLS booster synchrotron radiation profiles
based on 1 msec CCD exposure time at different energy
ramping point (Energy scan mode).
2500

Horizontal
VerticalTable 1: Eight Captures Average Beam Size of the
Horizontal and Vertical and its Standard Deviation at Varied
Energy Points
Trigger (ms)Energy (MeV)

10
188

20
550

30
999

40
1362

x (mm)1.96±0.16

1.09±0.12

0.77±0.03

0.91±0.01

y (mm)0.61±0.03

0.48±0.04

0.26±0.02

0.18±0.01

1500*CCD parameters: exposure time = 1 msec, gain = 0.

1000

SUMMARY

500

0
0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

1.6

Energy (GeV)

Figure 8: Measured variation of beam size with energy
ramping point.
1.0

Center X
Center Y
0.5

 Position (mm)adjusting the gain value of CCD, which can effectively
reduce the variation. An average beam size of horizontal
and vertical and its deviation at varied energy points isshown in Table 1. The design of the current imaging
system of the TLS booster synchrotron radiation monitor
allows measurement of all required parameters (beam size,
centroid and orientation tilt angle) with sufficient
resolution for current beam tests.

0.0

The design and implementation of the beam image
diagnostics system for the TPS are in proceed. A
distributed EPICS IOC system based image profile
diagnostics solution was proposed, which are based on
GigE Vision CCD camera with PoE support. Compiled
Matlab programs are running in this platform as a dataprocessing engine, this approach is efficient method todevelop image analysis application. The prototype will be
implemented and tested for all screen monitors of the TPS
and synchrotron radiation monitor of the TLS booster
synchrotron. The testing results shown the system cansatisfy the requirement of TPS.

REFERENCES

-0.5

-1.0
0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

1.6

Energy (GeV)

Figure 9: Measured variation of the position of the beam
centre with energy ramping point.
The stability of the ramping process of the booster
synchrotron plays an important role as injector for asynchrotron light source. The TLS booster synchrotron isdesigned to accelerate electrons from linac 50 MeV
injection to full operational energy 1.5 GeV with stored
beam current about a few mA. This repetition rate is 10
Hz. Continuous observation of the difference of beamprofile variation during ramping energy can be used asindicator related to the operation stability of the booster
synchrotron. With the CCD trigger delay fixed at 10, 20,
30 and 40 ms, the ramping beam profiles (eight times) arerecorded. These results of the beam profile show that thebeam size slightly altered at the same ramping energy
point during the eight captures, especially in the low
energy region. The possible reason of this variation may
be the signal-to-noise ratio lower at the lower energy
region. Experiments confirmed that by appropriately[1] TPS Design Handbook, version 16, June 2009.
[2] J. Tous et al., Nucl. Instrum. Meth. A, 591 (2008)
264.
[3] T. Kawakubo et al., Nucl. Instrum. Meth. A, 302(1991) 397.
[4] C.H. Kuo et al., “The Profile Measurement ofSynchrotron Radiation Monitor in NSRRC,”ICALEPCS’03, Gyeongju, October 2003, WP581, p.
536 (2003).
[5] ADLINK, http://www.adlinktech.com[6] C.Y. Wu et al. “Preliminary Testing of TPS Timing
System,” IPAC’11, San Sebastián, September 2011,
MOPO041, p. 574 (2011).
[7] Channel Access, http://www.aps.anl.gov/epics/docs/
ca.php.
[8] Mark Rivers, areaDetector: EPICS software for area
detectors.
[9] ACCEL Instruments GmbH, TPS Linac Technical
Design Report, Document 2008–BP-8067.

ISBN 978-3-95450-119-9
Data Acquisition Techniques5c 2012 by the respective authors — cc Creative Commons Attribution 3.0 (CC BY 3.0)
Copyright ○Beam Size (m)2000

MOPA33